mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
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:
@@ -67,6 +67,7 @@ BJJ = "0x1b176232f78ba0d388ecc5f4896eca2d3b3d4f272092469f559247297f5c0c13"
|
||||
[Coordinator.L2DB]
|
||||
SafetyPeriod = 10
|
||||
MaxTxs = 512
|
||||
MinFeeUSD = 0.0
|
||||
TTL = "24h"
|
||||
PurgeBatchDelay = 10
|
||||
InvalidateBatchDelay = 20
|
||||
|
||||
@@ -173,6 +173,7 @@ func cmdDiscard(c *cli.Context) error {
|
||||
db,
|
||||
cfg.Coordinator.L2DB.SafetyPeriod,
|
||||
cfg.Coordinator.L2DB.MaxTxs,
|
||||
cfg.Coordinator.L2DB.MinFeeUSD,
|
||||
cfg.Coordinator.L2DB.TTL.Duration,
|
||||
nil,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user