Skip to content

Commit

Permalink
Merge pull request #3376 from jorgemmsilva/feat/gas-auction-mempool
Browse files Browse the repository at this point in the history
Feat: mempool gas auction
  • Loading branch information
jorgemmsilva authored Apr 23, 2024
2 parents 13579da + 3aac8b2 commit eed40b5
Show file tree
Hide file tree
Showing 32 changed files with 1,042 additions and 441 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ linters:
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
- exportloopref # Checks for pointers to enclosing loop variables.
- funlen # Tool for detection of long functions.
- goconst # Finds repeated strings that could be replaced by a constant.
- gocritic # Provides many diagnostics that check for bugs, performance and style issues.
- gocyclo # Computes and checks the cyclomatic complexity of functions.
- goerr113 # Golang linter to check the errors handling expressions.
Expand Down Expand Up @@ -186,6 +185,7 @@ linters:
- wastedassign # wastedassign finds wasted assignment statements. [fast: true, auto-fix: false]


# - goconst # Finds repeated strings that could be replaced by a constant.
# - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
# nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false]
# don't enable:
Expand Down
11 changes: 10 additions & 1 deletion components/chains/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
hiveshutdown "github.com/iotaledger/hive.go/app/shutdown"
"github.com/iotaledger/wasp/packages/chain"
"github.com/iotaledger/wasp/packages/chain/cmt_log"
"github.com/iotaledger/wasp/packages/chain/mempool"
"github.com/iotaledger/wasp/packages/chains"
"github.com/iotaledger/wasp/packages/daemon"
"github.com/iotaledger/wasp/packages/database"
Expand Down Expand Up @@ -128,7 +129,15 @@ func provide(c *dig.Container) error {
deps.NodeIdentityProvider,
deps.ConsensusStateRegistry,
deps.ChainListener,
ParamsChains.MempoolTTL,
mempool.Settings{
TTL: ParamsChains.MempoolTTL,
OnLedgerRefreshMinInterval: ParamsChains.MempoolOnLedgerRefreshMinInterval,
MaxOffledgerInPool: ParamsChains.MempoolMaxOffledgerInPool,
MaxOnledgerInPool: ParamsChains.MempoolMaxOnledgerInPool,
MaxTimedInPool: ParamsChains.MempoolMaxTimedInPool,
MaxOnledgerToPropose: ParamsChains.MempoolMaxOnledgerToPropose,
MaxOffledgerToPropose: ParamsChains.MempoolMaxOffledgerToPropose,
},
ParamsChains.BroadcastInterval,
shutdown.NewCoordinator("chains", Component.Logger().Named("Shutdown")),
deps.ChainMetricsProvider,
Expand Down
34 changes: 20 additions & 14 deletions components/chains/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,26 @@ import (
)

type ParametersChains struct {
BroadcastUpToNPeers int `default:"2" usage:"number of peers an offledger request is broadcasted to"`
BroadcastInterval time.Duration `default:"0s" usage:"time between re-broadcast of offledger requests; 0 value means that re-broadcasting is disabled"`
APICacheTTL time.Duration `default:"300s" usage:"time to keep processed offledger requests in api cache"`
PullMissingRequestsFromCommittee bool `default:"true" usage:"whether or not to pull missing requests from other committee members"`
DeriveAliasOutputByQuorum bool `default:"true" usage:"false means we propose own AliasOutput, true - by majority vote."`
PipeliningLimit int `default:"-1" usage:"-1 -- infinite, 0 -- disabled, X -- build the chain if there is up to X transactions unconfirmed by L1."`
PostponeRecoveryMilestones int `default:"3" usage:"number of milestones to wait until a chain transition is considered as rejected"`
ConsensusDelay time.Duration `default:"500ms" usage:"Minimal delay between consensus runs."`
RecoveryTimeout time.Duration `default:"20s" usage:"Time after which another consensus attempt is made."`
RedeliveryPeriod time.Duration `default:"2s" usage:"the resend period for msg."`
PrintStatusPeriod time.Duration `default:"3s" usage:"the period to print consensus instance status."`
ConsensusInstsInAdvance int `default:"3" usage:""`
AwaitReceiptCleanupEvery int `default:"100" usage:"for every this number AwaitReceipt will be cleaned up"`
MempoolTTL time.Duration `default:"24h" usage:"Time that requests are allowed to sit in the mempool without being processed"`
BroadcastUpToNPeers int `default:"2" usage:"number of peers an offledger request is broadcasted to"`
BroadcastInterval time.Duration `default:"0s" usage:"time between re-broadcast of offledger requests; 0 value means that re-broadcasting is disabled"`
APICacheTTL time.Duration `default:"300s" usage:"time to keep processed offledger requests in api cache"`
PullMissingRequestsFromCommittee bool `default:"true" usage:"whether or not to pull missing requests from other committee members"`
DeriveAliasOutputByQuorum bool `default:"true" usage:"false means we propose own AliasOutput, true - by majority vote."`
PipeliningLimit int `default:"-1" usage:"-1 -- infinite, 0 -- disabled, X -- build the chain if there is up to X transactions unconfirmed by L1."`
PostponeRecoveryMilestones int `default:"3" usage:"number of milestones to wait until a chain transition is considered as rejected"`
ConsensusDelay time.Duration `default:"500ms" usage:"Minimal delay between consensus runs."`
RecoveryTimeout time.Duration `default:"20s" usage:"Time after which another consensus attempt is made."`
RedeliveryPeriod time.Duration `default:"2s" usage:"the resend period for msg."`
PrintStatusPeriod time.Duration `default:"3s" usage:"the period to print consensus instance status."`
ConsensusInstsInAdvance int `default:"3" usage:""`
AwaitReceiptCleanupEvery int `default:"100" usage:"for every this number AwaitReceipt will be cleaned up"`
MempoolTTL time.Duration `default:"24h" usage:"Time that requests are allowed to sit in the mempool without being processed"`
MempoolMaxOffledgerInPool int `default:"2000" usage:"Maximum number of off-ledger requests kept in the mempool"`
MempoolMaxOnledgerInPool int `default:"1000" usage:"Maximum number of on-ledger requests kept in the mempool"`
MempoolMaxTimedInPool int `default:"100" usage:"Maximum number of timed on-ledger requests kept in the mempool"`
MempoolMaxOffledgerToPropose int `default:"500" usage:"Maximum number of off-ledger requests to propose for the next block"`
MempoolMaxOnledgerToPropose int `default:"100" usage:"Maximum number of on-ledger requests to propose for the next block (includes timed requests)"`
MempoolOnLedgerRefreshMinInterval time.Duration `default:"10m" usage:"Minimum interval to try to refresh the list of on-ledger requests after some have been dropped from the pool (this interval is introduced to avoid dropping/refreshing cycle if there are too many requests on L1 to process)"`
}

type ParametersWAL struct {
Expand Down
Loading

0 comments on commit eed40b5

Please sign in to comment.