-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: enable Shanghai EIPs #1970
Conversation
3caec6f
to
4350d2d
Compare
4350d2d
to
4f85e2d
Compare
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useful to reuse test caes in ./tests
@@ -118,42 +118,40 @@ func TestFilters(t *testing.T) { | |||
contract = common.Address{0xfe} | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we change logic in func CalcBaseFee
so we revert this test case, and keep it align with go-ethereum
@@ -93,7 +93,7 @@ type testMatcher struct { | |||
failpat []testFailure | |||
skiploadpat []*regexp.Regexp | |||
slowpat []*regexp.Regexp | |||
runonlylistpat *regexp.Regexp | |||
runonlylistpat []*regexp.Regexp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make runonlylistpat
is a list of patterns, so we can add more than one pattern
@@ -300,7 +300,7 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh | |||
// And _now_ get the state root | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
e2635ad
to
762804a
Compare
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
core: enable Shanghai EIPs
Rationale
more compatible with ethereum/evm, 6 points need to check
Example
a. Parlia.FinalizeAndAssemble ignore
Withdrawals
b. 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: