-
Notifications
You must be signed in to change notification settings - Fork 2
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
Upgrade EVM to Cancun #97
base: master
Are you sure you want to change the base?
Conversation
I see that we have difficulty to validate this PR. Here are what is exactly included in this PR:
References: |
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.
So far this PR lacks of unit tests, for example transitioning from pre-EIP712 to post-EIP712 simulation.
Another big missing is the random value which is serving PREVRANDAO
opcode is not properly created in EVM context. Following go-ethereum, this value is calculated each block below
if header.Difficulty.Sign() == 0 {
random = &header.MixDigest
}
Also could you declare why we need the RANDOM
opcode? I see that it's totally duplicated with PREVRANDAO
Updated as requested. |
}), db, n, gen) | ||
} | ||
|
||
func TestEVMTransition(t *testing.T) { |
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.
Need another transient storage reset test like https://github.com/ethereum/go-ethereum/blob/8032b63f167938e6441d4be3eb49b12014d9bfc8/core/blockchain_test.go#L4029
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.
I reckon that the TSTORE logic is simple enough that more integration tests are needed instead
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.
Sure we need more integration tests, but the priciple of unit testing is trying to cover more cases. These two method of testing should take different repsonsibilities. So we need to cover as much cases we found out for more code coveraged, as well as detect clashing with future changes
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.
Yes, double check is never enough, also prevent breaking changes from passing unnoticed afterward
Implement eth_getBlockReceipts API
We can calculate the // GetPrevRandao returns the PrevRandao for current block.
func (b *Block) GetPrevRandao() common.Hash {
if b.prevRandao == (common.Hash{}) {
b.computePrevRandao()
}
return b.prevRandao
}
// computePrevRandao computes the PrevRandao from transaction hashes.
func (b *Block) computePrevRandao() {
for _, event := range b.Events {
for i := 0; i < 24; i++ {
// first 8 bytes should be ignored as they are not pseudo-random.
b.prevRandao[i+8] = b.prevRandao[i+8] ^ event[i+8]
}
}
} |
@trinhdn97 |
Cancun
hard fork feature activatorsPlease check if what you want to add to
go-u2u
list meets Contribution guidelines, maintainers note and Quality standard.