-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
[WIP] Merge interop spec #23607
[WIP] Merge interop spec #23607
Conversation
Hi there, thanks for publishing the test vectors. It's much appreciated! I have been working on these vectors and have found some discrepancies. I've raised them on TG/Discord, but I thought it might be helpful to have them collated on Github. Here are the discrepancies:
|
Thank you for looking into it! Most of the issues were already fixed in code. |
I just ran the Lighthouse tests against Geth and I can confirm all those previous issues have been fixed. Thank you 🎉 There are still two things remaining:
According to EIP-3675:
This issue can be recreated with a modified version of the test vectors: Request:
Response:
|
eth: reqid dispatcher, nuke fast sync, add beacon sync
eth: minor sync polishes
eth/catalyst/api.go
Outdated
} | ||
parent := api.eth.BlockChain().GetBlockByHash(params.ParentHash) | ||
if parent == nil { | ||
return INVALID, fmt.Errorf("could not find parent %x", params.ParentHash) |
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 don't think this will work. Our RPC server implementation, AFAIK, when dealing with a non-nil return and a non-nil error, will discard the return vaue and return only the error. This might even be a 'feature' of json rpc: either you return a response XOR an error. Our server chooses the error.
core, eth: various tiny fixups integrating sync
core/blockchain.go
Outdated
vmConfig vm.Config | ||
|
||
shouldPreserve func(*types.Block) bool // Function used to determine whether should preserve the given block. | ||
shouldPreserve func(*types.Block) bool // Function used to determine whether should preserve the given block. | ||
terminateInsert func(common.Hash, uint64) bool // Testing hook used to terminate ancient receipt chain insertion. |
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.
stale code? I don't see any references to this elsewhere.
eth: disable legacy syncing on the merge interop pr for now
core: overwrite head header and fast block too on block sethead
eth/downloader: restart the downloader after completion on new head
eth: only sync with peers below the ttd
// (b) the timestamp is not verified anymore | ||
func (beacon *Beacon) verifyHeader(chain consensus.ChainHeaderReader, header, parent *types.Header) error { | ||
// Ensure that the header's extra-data section is of a reasonable size | ||
if len(header.Extra) > 32 { |
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.
32
should go to enum or const
return fmt.Errorf("invalid difficulty: have %v, want %v", header.Difficulty, beaconDifficulty) | ||
} | ||
// Verify that the gas limit is <= 2^63-1 | ||
cap := uint64(0x7fffffffffffffff) |
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.
same here, it could be extracted outside the function
// to a chain, so the difficulty will be left unset (nil). Set it here to the | ||
// correct value. | ||
if b.header.Difficulty == nil { | ||
b.header.Difficulty = big.NewInt(2) |
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.
2
could be extracted to enum/const with proper name
This PR contains a first implementation of the interop spec rebased on current master
to test: