edr icon indicating copy to clipboard operation
edr copied to clipboard

Don't accept remote blocks without mixHash fields in `L1ChainSpec`

Open fvictorio opened this issue 1 year ago • 4 comments

In https://github.com/NomicFoundation/edr/pull/516 we changed the code to accept remote blocks without mixHash fields. If the field is not present, the default (zero) value is used. We did this to accommodate EVM-compatible chains that don't have this field.

A GenericChainSpec exists that is more permissive, including allowing for missing mixHash. The L1ChainSpec should be stricter and require mixHash to be present.

Search for TODO comments with the following issue mentioned to resolve this issue: https://github.com/NomicFoundation/edr/issues/518

fvictorio avatar Jun 17 '24 09:06 fvictorio

I think the title of the issue makes an implicit assumption that we'd just reject working with networks that we don't fully understand/support. This is contrary to how Hardhat Network has been working so far.

alcuadrado avatar Jun 17 '24 18:06 alcuadrado

Yes, we need to discuss this more.

@Wodann suggested something I quite like: besides support for Ethereum Mainnet and Optimism, we could have a "Fallback" chain type which is more permissive. In that case, a mix hash wouldn't be accepted in "Ethereum Mainnet" mode, but it would in fallback mode.

fvictorio avatar Jun 18 '24 07:06 fvictorio

Closing this because it's pretty clear that we'll have that fallback chain type, which would make this a non-issue.

fvictorio avatar Jul 11 '24 14:07 fvictorio

Despite having a GenericChainSpec, this change was never incorporated into the L1ChainSpec.

Wodann avatar Nov 03 '25 17:11 Wodann