Add minPriceUSD in L2DB, check maxTxs atomically

- Add config parameter `Coordinator.L2DB.MinPriceUSD` which allows rejecting
  txs to the pool that have a fee lower than the minimum.
- In pool tx insertion, checking the number of pending txs atomically with the
  insertion to avoid data races leading to more than MaxTxs pending txs in the
  pool.
This commit is contained in:
Eduard S
2021-02-22 16:37:18 +01:00
parent df0cc32eed
commit 3706ddb2fb
17 changed files with 271 additions and 127 deletions

View File

@@ -205,6 +205,7 @@ func NewNode(mode Mode, cfg *config.Node) (*Node, error) {
db,
cfg.Coordinator.L2DB.SafetyPeriod,
cfg.Coordinator.L2DB.MaxTxs,
cfg.Coordinator.L2DB.MinFeeUSD,
cfg.Coordinator.L2DB.TTL.Duration,
apiConnCon,
)