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

Add era file support #3883

Merged
merged 4 commits into from
Feb 25, 2025
Merged

Add era file support #3883

merged 4 commits into from
Feb 25, 2025

Conversation

acolytec3
Copy link
Contributor

@acolytec3 acolytec3 commented Feb 25, 2025

This adds support for the era format which contains SignedBeaconBlock and BeaconState objects.

Note, this currently only support era files from deneb and later since the underlying SSZ types from micro-eth-signer are limited to deneb types.

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.87%. Comparing base (8630cc8) to head (4c87e9e).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 76.87% <ø> (ø)
blockchain 85.69% <ø> (ø)
client 66.26% <ø> (-0.02%) ⬇️
common 90.73% <ø> (ø)
devp2p 76.27% <ø> (ø)
ethash 81.04% <ø> (ø)
evm 71.04% <ø> (ø)
genesis 99.84% <ø> (ø)
mpt 59.72% <ø> (ø)
rlp 69.70% <ø> (ø)
statemanager 70.47% <ø> (ø)
tx 80.96% <ø> (ø)
util 85.54% <ø> (ø)
vm 57.81% <ø> (ø)
wallet 83.78% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@ScottyPoi ScottyPoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can confirm this works with post-deneb era files.

Approving with a TODO to fill in the missing ssz types, either after an update from micro-eth-signer or manually here in the era package

@acolytec3 acolytec3 merged commit a3c4c98 into master Feb 25, 2025
40 of 41 checks passed
@ScottyPoi
Copy link
Contributor

This can be tested with a simple script like:


const file = await fetch('https://mainnet.era.nimbus.team/mainnet-01340-429201f5.era')
const fileBytes = new Uint8Array(await file.arrayBuffer())

const blocks = readBlocksFromEra(fileBytes)
for await (const block of blocks) {
    console.log(block)
}

@acolytec3 acolytec3 deleted the implement-era-support branch February 25, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants