core: enable Shanghai EIPs#1970
core: enable Shanghai EIPs#1970brilliant-lx merged 3 commits intobnb-chain:developfrom buddh0:shanghai_hardfork
Conversation
| return new(big.Int).SetUint64(params.InitialBaseFee) | ||
| } | ||
|
|
||
| // If the current block is the first EIP-1559 block, return the InitialBaseFee. |
There was a problem hiding this comment.
useful to reuse test caes in ./tests
| contract2 = common.Address{0xff} | ||
| abiStr = `[{"inputs":[],"name":"log0","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"t1","type":"uint256"}],"name":"log1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"t1","type":"uint256"},{"internalType":"uint256","name":"t2","type":"uint256"}],"name":"log2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"t1","type":"uint256"},{"internalType":"uint256","name":"t2","type":"uint256"},{"internalType":"uint256","name":"t3","type":"uint256"}],"name":"log3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"t1","type":"uint256"},{"internalType":"uint256","name":"t2","type":"uint256"},{"internalType":"uint256","name":"t3","type":"uint256"},{"internalType":"uint256","name":"t4","type":"uint256"}],"name":"log4","outputs":[],"stateMutability":"nonpayable","type":"function"}]` | ||
| // BaseFee in BSC is 0 now, use 1Gwei instead for test here to avoid 0 gasPrice | ||
| gasPrice1Gwei = big.NewInt(params.GWei) |
There was a problem hiding this comment.
because we change logic in func CalcBaseFee
so we revert this test case, and keep it align with go-ethereum
| skiploadpat []*regexp.Regexp | ||
| slowpat []*regexp.Regexp | ||
| runonlylistpat *regexp.Regexp | ||
| runonlylistpat []*regexp.Regexp |
There was a problem hiding this comment.
make runonlylistpat is a list of patterns, so we can add more than one pattern
| root := statedb.IntermediateRoot(config.IsEIP158(block.Number())) | ||
| statedb.SetExpectedStateRoot(root) | ||
| root, _, err = statedb.Commit(block.NumberU64(), nil) | ||
| root, _, _ = statedb.Commit(block.NumberU64(), nil) |
There was a problem hiding this comment.
keep align with go-ethereum,
otherwise some cases will fail
|
Are we enabling the running of the testcases under |
when bsc fork from go-ethereum, many cases in |
|
Which parts specifically refer to enabling Shanghai EIPs apart from the instructionSet code change? I see changes in tests and String() but couldn't quite understand the portions which actually turn Shanghai ON. |
define ShanghaiTime in |
This fix fixes most of the failing tests happened on bnb-chain#1970
This fix fixes most of the failing tests happened on bnb-chain/bsc#1970
Description
core: enable Shanghai EIPs
Rationale
more compatible with ethereum/evm, 6 points need to check
Example
a. Parlia.FinalizeAndAssemble ignore
Withdrawalsb. Parlia.verifyHeader ensure header.WithdrawalsHash == nil
c. ValidateBody ensure block.Withdrawals()==nil
reuse handreds of test cases in https://github.com/ethereum/tests
PS: BEP-312 just used as a way to announce, no code need to change
Changes
Notable changes: