Skip to content

Commit

Permalink
Skip EVM nonce check until Changi Intermediate fork (#2093)
Browse files Browse the repository at this point in the history
* Skip EVM nonce check until Changi Intermediate fork

* Fork guard before commiting backend changes related to prepay gas

* Revert "Fork guard before commiting backend changes related to prepay gas"

This reverts commit 76f0e3e.

---------

Co-authored-by: jouzo <[email protected]>
  • Loading branch information
Bushstar and Jouzo authored Jun 20, 2023
1 parent 6f60181 commit 26e0188
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/masternodes/mn_checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3905,9 +3905,12 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor {
CrossBoundaryResult result;
const auto hashAndGas = evm_try_prevalidate_raw_tx(result, HexStr(obj.evmTx), true);

if (!result.ok) {
LogPrintf("[evm_try_prevalidate_raw_tx] failed, reason : %s\n", result.reason);
return Res::Err("evm tx failed to validate %s", result.reason);
// Completely remove this fork guard on mainnet upgrade to restore nonce check from EVM activation
if (height >= static_cast<uint32_t>(consensus.ChangiIntermediateHeight)) {
if (!result.ok) {
LogPrintf("[evm_try_prevalidate_raw_tx] failed, reason : %s\n", result.reason);
return Res::Err("evm tx failed to validate %s", result.reason);
}
}

evm_try_queue_tx(result, evmContext, HexStr(obj.evmTx), tx.GetHash().ToArrayReversed());
Expand Down
2 changes: 1 addition & 1 deletion test/functional/feature_evm_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.extra_args = [
['-dummypos=0', '-txnotokens=0', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-fortcanningepilogueheight=96', '-grandcentralheight=101', '-nextnetworkupgradeheight=105', '-subsidytest=1', '-txindex=1'],
['-dummypos=0', '-txnotokens=0', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-fortcanningepilogueheight=96', '-grandcentralheight=101', '-nextnetworkupgradeheight=105', '-changiintermediateheight=105', '-subsidytest=1', '-txindex=1'],
]

def setup(self):
Expand Down

0 comments on commit 26e0188

Please sign in to comment.