Skip to content

Commit

Permalink
fixed issue after merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Shailu-s committed Dec 23, 2024
1 parent 729d7b9 commit f6b26c1
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
19 changes: 19 additions & 0 deletions sequencer/cfg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,25 @@ Address = "0x56232B1c5B10038125Bc7345664B4AFD745bcF8E"
## BJJ is the baby jub jub public key of the account that will receive the fees
BJJ = "0x130c5c7f294792559f469220274f3d3b2dca6e89f4c5ec88d3a08bf73262171b"

[Coordinator.L2DB]
### Number of batches after which non-pending L2Txs are deleted from the pool
SafetyPeriod = 10
### Maximum number of pending L2Txs that can be stored in the pool
MaxTxs = 1000000
### Minimum fee in USD that a tx must pay in order to be accepted into the pool
MinFeeUSD = 0.10
### Maximum fee in USD that a tx must pay in order to be accepted into the pool
MaxFeeUSD = 10.00
### Time To Live for L2Txs in the pool. L2Txs older than TTL will be deleted.
TTL = "24h"
### Delay between batches to purge outdated transactions. Outdated L2Txs are those that have been forged or marked as invalid for longer than the SafetyPeriod and pending L2Txs that have been in the pool for longer than TTL once there are MaxTxs
PurgeBatchDelay = 10
### Delay between batches to mark invalid transactions due to nonce lower than the account nonce
InvalidateBatchDelay = 20
### Delay between blocks to purge outdated transactions. Outdated L2Txs are those that have been forged or marked as invalid for longer than the SafetyPeriod and pending L2Txs that have been in the pool for longer than TTL once there are MaxTxs.
PurgeBlockDelay = 10
### Delay between blocks to mark invalid transactions due to nonce lower than the account nonce
InvalidateBlockDelay = 20

[Coordinator.TxSelector]
### Path where the TxSelector StateDB is stored
Expand Down
56 changes: 56 additions & 0 deletions sequencer/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,47 @@ type Coordinator struct {
SyncRetryInterval Duration `validate:"required" env:"TONNODE_COORDINATOR_SYNCRETRYINTERVAL"`
// ProverWaitReadTimeout
ProverWaitReadTimeout Duration `env:"TONNODE_COORDINATOR_PROVERWAITREADTIMEOUT"`
L2DB struct {
// SafetyPeriod is the number of batches after which
// non-pending L2Txs are deleted from the pool
SafetyPeriod common.BatchNum `validate:"required" env:"TONNODE_L2DB_SAFETYPERIOD"`
// MaxTxs is the maximum number of pending L2Txs that can be
// stored in the pool. Once this number of pending L2Txs is
// reached, inserts to the pool will be denied until some of
// the pending txs are forged.
MaxTxs uint32 `validate:"required" env:"TONNODE_L2DB_MAXTXS"`
// MinFeeUSD is the minimum fee in USD that a tx must pay in
// order to be accepted into the pool. Txs with lower than
// minimum fee will be rejected at the API level.
MinFeeUSD float64 `validate:"gte=0" env:"TONNODE_L2DB_MINFEEUSD"`
// MaxFeeUSD is the maximum fee in USD that a tx must pay in
// order to be accepted into the pool. Txs with greater than
// maximum fee will be rejected at the API level.
MaxFeeUSD float64 `validate:"required,gte=0" env:"TONNODE_L2DB_MAXFEEUSD"`
// TTL is the Time To Live for L2Txs in the pool. L2Txs older
// than TTL will be deleted.
TTL Duration `validate:"required" env:"TONNODE_L2DB_TTL"`
// PurgeBatchDelay is the delay between batches to purge
// outdated transactions. Outdated L2Txs are those that have
// been forged or marked as invalid for longer than the
// SafetyPeriod and pending L2Txs that have been in the pool
// for longer than TTL once there are MaxTxs.
PurgeBatchDelay int64 `validate:"required,gte=0" env:"TONNODE_L2DB_PURGEBATCHDELAY"`
// InvalidateBatchDelay is the delay between batches to mark
// invalid transactions due to nonce lower than the account
// nonce.
InvalidateBatchDelay int64 `validate:"required" env:"TONNODE_L2DB_INVALIDATEBATCHDELAY"`
// PurgeBlockDelay is the delay between blocks to purge
// outdated transactions. Outdated L2Txs are those that have
// been forged or marked as invalid for longer than the
// SafetyPeriod and pending L2Txs that have been in the pool
// for longer than TTL once there are MaxTxs.
PurgeBlockDelay int64 `validate:"required,gte=0" env:"TONNODE_L2DB_PURGEBLOCKDELAY"`
// InvalidateBlockDelay is the delay between blocks to mark
// invalid transactions due to nonce lower than the account
// nonce.
InvalidateBlockDelay int64 `validate:"required,gte=0" env:"TONNODE_L2DB_INVALIDATEBLOCKDELAY"`
} `validate:"required"`
TxSelector struct {
// Path where the TxSelector StateDB is stored
Path string `validate:"required" env:"TONNODE_TXSELECTOR_PATH"`
Expand Down Expand Up @@ -308,6 +349,21 @@ type APIServer struct {
// Coordinator enables the coordinator API endpoints
Coordinator bool `env:"TONNODE_COORDINATORAPI_COORDINATOR"`
} `validate:"required"`
L2DB struct {
// MaxTxs is the maximum number of pending L2Txs that can be
// stored in the pool. Once this number of pending L2Txs is
// reached, inserts to the pool will be denied until some of
// the pending txs are forged.
MaxTxs uint32 `validate:"required" env:"TONNODE_L2DB_MAXTXS"`
// MinFeeUSD is the minimum fee in USD that a tx must pay in
// order to be accepted into the pool. Txs with lower than
// minimum fee will be rejected at the API level.
MinFeeUSD float64 `validate:"gte=0" env:"TONNODE_L2DB_MINFEEUSD"`
// MaxFeeUSD is the maximum fee in USD that a tx must pay in
// order to be accepted into the pool. Txs with greater than
// maximum fee will be rejected at the API level.
MaxFeeUSD float64 `validate:"required,gte=0" env:"TONNODE_L2DB_MAXFEEUSD"`
} `validate:"required"`
// Keystore is the ethereum keystore where private keys are kept.
// Required if API.CoordinatorNetwork == true
Keystore struct {
Expand Down

0 comments on commit f6b26c1

Please sign in to comment.