-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decorate AuRaTxFilters in order to disable them post merge (#4182)
* Decorate AuRaTxFilters in order to disable them post merge * Fix decorator for MinGasPriceContractTxFilter * Redesign & Refactor * Remove unused usings Co-authored-by: lukasz.rozmej <lukasz.rozmej@gmail.com>
- Loading branch information
1 parent
fac8017
commit 7418498
Showing
4 changed files
with
57 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Nethermind.Core; | ||
using Nethermind.TxPool; | ||
using Nethermind.Consensus.Transactions; | ||
using Nethermind.Consensus; | ||
|
||
namespace Nethermind.Merge.AuRa | ||
{ | ||
public class AuRaMergeTxFilter : ITxFilter | ||
{ | ||
private readonly IPoSSwitcher _poSSwitcher; | ||
private readonly ITxFilter _preMergeTxFilter; | ||
private readonly ITxFilter _postMergeTxFilter; | ||
|
||
public AuRaMergeTxFilter(IPoSSwitcher poSSwitcher, ITxFilter preMergeTxFilter, ITxFilter? postMergeTxFilter = null) | ||
{ | ||
_poSSwitcher = poSSwitcher; | ||
_preMergeTxFilter = preMergeTxFilter; | ||
_postMergeTxFilter = postMergeTxFilter ?? NullTxFilter.Instance; | ||
} | ||
|
||
public AcceptTxResult IsAllowed(Transaction tx, BlockHeader parentHeader) => | ||
_poSSwitcher.IsPostMerge(parentHeader) | ||
? _postMergeTxFilter.IsAllowed(tx, parentHeader) | ||
: _preMergeTxFilter.IsAllowed(tx, parentHeader); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters