forked from TrueCloudLab/neoneo-go
core: implement basic policying support, fix #370
Implement mempool and consensus block creation policies, almost the same as SimplePolicy plugin for C# node provides with two caveats: * HighPriorityTxType is not configured and hardcoded to ClaimType * BlockedAccounts are not supported Other than that it allows us to run successfuly as testnet CN, previously our proposals were rejected because we were proposing blocks with oversized transactions (that are rejected by PoolTx() now). Mainnet and testnet configuration files are updated accordingly, but privnet is left as is with no limits. Configuration is currently attached to the Blockchain and so is the code that does policying, it may be moved somewhere in the future, but it works for now.
This commit is contained in:
parent
22f5667530
commit
eb11e5fb11
8 changed files with 75 additions and 4 deletions
|
@ -46,7 +46,7 @@ type (
|
|||
AddressVersion byte `yaml:"AddressVersion"`
|
||||
SecondsPerBlock int `yaml:"SecondsPerBlock"`
|
||||
LowPriorityThreshold float64 `yaml:"LowPriorityThreshold"`
|
||||
MaxTransactionsPerBlock int64 `yaml:"MaxTransactionsPerBlock"`
|
||||
MaxTransactionsPerBlock int `yaml:"MaxTransactionsPerBlock"`
|
||||
MemPoolSize int `yaml:"MemPoolSize"`
|
||||
StandbyValidators []string `yaml:"StandbyValidators"`
|
||||
SeedList []string `yaml:"SeedList"`
|
||||
|
@ -59,6 +59,13 @@ type (
|
|||
FreeGasLimit util.Fixed8 `yaml:"FreeGasLimit"`
|
||||
// SaveStorageBatch enables storage batch saving before every persist.
|
||||
SaveStorageBatch bool `yaml:"SaveStorageBatch"`
|
||||
// Maximum number of low priority transactions accepted into block.
|
||||
MaxFreeTransactionsPerBlock int `yaml:"MaxFreeTransactionsPerBlock"`
|
||||
// Maximum size of low priority transaction in bytes.
|
||||
MaxFreeTransactionSize int `yaml:"MaxFreeTransactionSize"`
|
||||
// FeePerExtraByte sets the expected per-byte fee for
|
||||
// transactions exceeding the MaxFreeTransactionSize.
|
||||
FeePerExtraByte float64 `yaml:"FeePerExtraByte"`
|
||||
}
|
||||
|
||||
// SystemFee fees related to system.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue