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:
@@ -105,6 +105,10 @@ type Coordinator struct {
|
||||
// reached, inserts to the pool will be denied until some of
|
||||
// the pending txs are forged.
|
||||
MaxTxs uint32 `validate:"required"`
|
||||
// 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
|
||||
// TTL is the Time To Live for L2Txs in the pool. Once MaxTxs
|
||||
// L2Txs is reached, L2Txs older than TTL will be deleted.
|
||||
TTL Duration `validate:"required"`
|
||||
|
||||
Reference in New Issue
Block a user