Skip to content
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

[Bug] RLP roundtrip fails for Anvil header #1575

Closed
Wollac opened this issue Oct 27, 2024 · 1 comment
Closed

[Bug] RLP roundtrip fails for Anvil header #1575

Wollac opened this issue Oct 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Wollac
Copy link
Contributor

Wollac commented Oct 27, 2024

Component

consensus, eips, genesis

What version of Alloy are you on?

alloy-consensus v0.5.4

Operating System

None

Describe the bug

After the recent changes in the RLP code of alloy_consensus::Header, the following code fails due to an invalid RLP encoding:

let provider = ProviderBuilder::new().on_anvil();
let block = provider.get_block_by_number(0.into(), false).await.unwrap().unwrap();
let header: alloy_consensus::Header = block.header.try_into().unwrap();

// RLP encode and decode the header
let rlp = alloy_rlp::encode(&header);
alloy_consensus::Header::decode(&mut &rlp[..]).expect("should decode");

This is because the Anvil RPC (observed in various versions including the latest nightly) returns a block that includes blobGasUsed and excessBlobGas, but not withdrawalsRoot. This may be inconsistent or even wrong behavior by Anvil, but I raise it here first because this code worked in previous versions of alloy.

I would like to raise awareness about whether this particular response case should be handled in alloy, or if a failing try_into etc. would be the desired behavior.

@Wollac Wollac added the bug Something isn't working label Oct 27, 2024
@klkvr
Copy link
Member

klkvr commented Oct 27, 2024

@klkvr klkvr closed this as completed Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants