core: set gas limit to transaction.SystemFee for all transactions

This commit is contained in:
Evgenii Stratonikov 2020-06-18 22:17:48 +03:00
parent 37164ee4ef
commit 84387b2416
4 changed files with 2 additions and 9 deletions

View file

@ -19,7 +19,6 @@ ProtocolConfiguration:
- seed5.neo.org:10333
VerifyBlocks: true
VerifyTransactions: false
FreeGasLimit: 10.0
MaxTransactionsPerBlock: 500
MaxFreeTransactionsPerBlock: 20
MaxFreeTransactionSize: 1024

View file

@ -19,7 +19,6 @@ ProtocolConfiguration:
- seed5t.neo.org:20333
VerifyBlocks: true
VerifyTransactions: false
FreeGasLimit: 10.0
MaxTransactionsPerBlock: 500
MaxFreeTransactionsPerBlock: 20
MaxFreeTransactionSize: 1024

View file

@ -2,7 +2,6 @@ package config
import (
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
"github.com/nspcc-dev/neo-go/pkg/util"
)
// ProtocolConfiguration represents the protocol config.
@ -10,9 +9,7 @@ type (
ProtocolConfiguration struct {
// FeePerExtraByte sets the expected per-byte fee for
// transactions exceeding the MaxFreeTransactionSize.
FeePerExtraByte float64 `yaml:"FeePerExtraByte"`
// FreeGasLimit is an amount of GAS which can be spent for free.
FreeGasLimit util.Fixed8 `yaml:"FreeGasLimit"`
FeePerExtraByte float64 `yaml:"FeePerExtraByte"`
LowPriorityThreshold float64 `yaml:"LowPriorityThreshold"`
Magic netmode.Magic `yaml:"Magic"`
MaxTransactionsPerBlock int `yaml:"MaxTransactionsPerBlock"`

View file

@ -605,9 +605,7 @@ func (bc *Blockchain) storeBlock(block *block.Block) error {
v := SpawnVM(systemInterop)
v.LoadScriptWithFlags(tx.Script, smartcontract.All)
v.SetPriceGetter(getPrice)
if bc.config.FreeGasLimit > 0 {
v.GasLimit = bc.config.FreeGasLimit + tx.SystemFee
}
v.GasLimit = tx.SystemFee
err := v.Run()
if !v.HasFailed() {