Skip to content

Electra upgrade#1283

Merged
claravanstaden merged 34 commits intomainfrom
electra
Feb 24, 2025
Merged

Electra upgrade#1283
claravanstaden merged 34 commits intomainfrom
electra

Conversation

@claravanstaden
Copy link
Copy Markdown
Contributor

@claravanstaden claravanstaden commented Sep 6, 2024

Changes

  • changes beacon config to include fork versions instead of just a deneb fork value.
  • adds Electra modified and new beacon structures

Testing

  • Beacon client updates for Electra updates work
  • Live switch-over from Deneb to Electra works
  • Smoke tests work

Resolves SNO-1140.

Companion: Snowfork/polkadot-sdk#178

}, nil
}

func DenebJsonExecutionPayloadHeaderToScale(e *beaconjson.FullExecutionPayloadHeaderJson) (scale.ExecutionPayloadHeaderDeneb, error) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unused method.

@claravanstaden claravanstaden marked this pull request as ready for review January 16, 2025 10:10
--rest.namespace="*" \
--jwt-secret $config_dir/jwtsecret \
--chain.archiveStateEpochFrequency 1 \
>"$output_dir/lodestar.log" 2>&1 &
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should it be output_electra_dir?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, it outputs to /tmp/snowbridge, which I think should be fine. :)

Comment on lines +15 to +16
if [ "$is_electra" == "true" ]; then
HOST=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This may not work for machines with multi-network interfaces, my PC, e.g.

➜  test git:(electra) ✗ ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
192.168.0.127
26.26.26.1
192.168.64.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You may be able to force bind docker to 127.0.0.1 when forwarding ports from host to container. But also maybe we should build from source to avoid docker.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Build from source: 23eb81d

Comment on lines +15 to +17
docker run --rm \
-v "${output_electra_dir}:/mnt" \
docker.io/ethpandaops/geth:lightclient-prague-devnet-4 \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would suggest not introducing docker for the local setup, can maybe build from source if necessary like lodestar.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Build geth from source: 23eb81d

Comment on lines +55 to +66
retries := 5
bootstrap, err := s.getCheckpoint()
if err != nil {
return scale.BeaconCheckpoint{}, fmt.Errorf("get finalized checkpoint: %w", err)
for retries > 0 {
retries = retries - 1
bootstrap, err = s.getCheckpoint()
if err != nil {
log.WithError(err).Info("retry bootstrap, sleeping")
time.Sleep(10 * time.Second)
continue
}
break
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious is the retry necessary here?

Copy link
Copy Markdown
Contributor Author

@claravanstaden claravanstaden Jan 22, 2025

Choose a reason for hiding this comment

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

I got intermittent failures from Lodestar (on the Mekong network) where a bootstrap payload was not available for the provided finalized checkpoint, so I added a retry, instead of having to retry the whole e2e script. :)

} else if forkVersion == protocol.Deneb {
beaconState = &state.BeaconStateDenebMainnet{}
} else {
beaconState = &state.BeaconStateCapellaMainnet{}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Capella branch can be deleted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +590 to +591
} else {
executionPayloadScale, err := api.CapellaExecutionPayloadToScale(sszBlock.ExecutionPayloadCapella())
executionPayloadScale, err := api.CapellaExecutionPayloadToScale(beaconBlock.ExecutionPayloadCapella())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can just remove the Capella branch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea, ac52035.

@claravanstaden claravanstaden requested a review from yrong January 22, 2025 08:53
Copy link
Copy Markdown
Contributor

@yrong yrong left a comment

Choose a reason for hiding this comment

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

Cool!

# Conflicts:
#	relayer/templates/inbound-fixtures.mustache
github-merge-queue bot pushed a commit to paritytech/polkadot-sdk that referenced this pull request Feb 21, 2025
# Description

Adds support for the upcoming Ethereum Electra upgrade, while
maintaining backwards compatibility for the current Deneb fork.

## Integration

Relayers should be updated to send updated Electra consensus data
structures.

## Review Notes

The [Ethereum Electra hard-fork
consensus](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/light-client/sync-protocol.md)
changes affecting the Ethereum light client are mainly isolated to the
[Generalized
Indexes](https://github.com/protolambda/eth2.0-ssz/blob/master/specs/navigation/generalized_indices.md)
of data structures changing. Before Electra, these values were hardcoded
in config. For Electra, these values change and needed to the updated.
Methods were added to return the correct g-index for the current fork
version.

Data structures used by the Ethereum client did not change in this
hard-fork. The BeaconState container has been updated with additional
changes, but because the on-chain code does not reference the
BeaconState directly (only indirectly through merkle proofs), it is not
a concern. Off-chain relayers use the BeaconState to generate proofs,
and so the relayer code has been updated accordingly.

### Companion PR for off-chain relayers
Snowfork/snowbridge#1283

---------

Co-authored-by: claravanstaden <Cats 4 life!>
Co-authored-by: Ron <yrong1997@gmail.com>
Co-authored-by: Vincent Geddes <vincent@snowfork.com>
Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>
Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
@claravanstaden claravanstaden merged commit 247f735 into main Feb 24, 2025
@claravanstaden claravanstaden deleted the electra branch February 24, 2025 08:12
github-actions bot pushed a commit to paritytech/polkadot-sdk that referenced this pull request Feb 24, 2025
# Description

Adds support for the upcoming Ethereum Electra upgrade, while
maintaining backwards compatibility for the current Deneb fork.

## Integration

Relayers should be updated to send updated Electra consensus data
structures.

## Review Notes

The [Ethereum Electra hard-fork
consensus](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/light-client/sync-protocol.md)
changes affecting the Ethereum light client are mainly isolated to the
[Generalized
Indexes](https://github.com/protolambda/eth2.0-ssz/blob/master/specs/navigation/generalized_indices.md)
of data structures changing. Before Electra, these values were hardcoded
in config. For Electra, these values change and needed to the updated.
Methods were added to return the correct g-index for the current fork
version.

Data structures used by the Ethereum client did not change in this
hard-fork. The BeaconState container has been updated with additional
changes, but because the on-chain code does not reference the
BeaconState directly (only indirectly through merkle proofs), it is not
a concern. Off-chain relayers use the BeaconState to generate proofs,
and so the relayer code has been updated accordingly.

### Companion PR for off-chain relayers
Snowfork/snowbridge#1283

---------

Co-authored-by: claravanstaden <Cats 4 life!>
Co-authored-by: Ron <yrong1997@gmail.com>
Co-authored-by: Vincent Geddes <vincent@snowfork.com>
Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>
Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
(cherry picked from commit dd7562a)
github-actions bot pushed a commit to paritytech/polkadot-sdk that referenced this pull request Feb 24, 2025
# Description

Adds support for the upcoming Ethereum Electra upgrade, while
maintaining backwards compatibility for the current Deneb fork.

## Integration

Relayers should be updated to send updated Electra consensus data
structures.

## Review Notes

The [Ethereum Electra hard-fork
consensus](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/light-client/sync-protocol.md)
changes affecting the Ethereum light client are mainly isolated to the
[Generalized
Indexes](https://github.com/protolambda/eth2.0-ssz/blob/master/specs/navigation/generalized_indices.md)
of data structures changing. Before Electra, these values were hardcoded
in config. For Electra, these values change and needed to the updated.
Methods were added to return the correct g-index for the current fork
version.

Data structures used by the Ethereum client did not change in this
hard-fork. The BeaconState container has been updated with additional
changes, but because the on-chain code does not reference the
BeaconState directly (only indirectly through merkle proofs), it is not
a concern. Off-chain relayers use the BeaconState to generate proofs,
and so the relayer code has been updated accordingly.

### Companion PR for off-chain relayers
Snowfork/snowbridge#1283

---------

Co-authored-by: claravanstaden <Cats 4 life!>
Co-authored-by: Ron <yrong1997@gmail.com>
Co-authored-by: Vincent Geddes <vincent@snowfork.com>
Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>
Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
(cherry picked from commit dd7562a)
github-actions bot pushed a commit to paritytech/polkadot-sdk that referenced this pull request Feb 24, 2025
# Description

Adds support for the upcoming Ethereum Electra upgrade, while
maintaining backwards compatibility for the current Deneb fork.

## Integration

Relayers should be updated to send updated Electra consensus data
structures.

## Review Notes

The [Ethereum Electra hard-fork
consensus](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/light-client/sync-protocol.md)
changes affecting the Ethereum light client are mainly isolated to the
[Generalized
Indexes](https://github.com/protolambda/eth2.0-ssz/blob/master/specs/navigation/generalized_indices.md)
of data structures changing. Before Electra, these values were hardcoded
in config. For Electra, these values change and needed to the updated.
Methods were added to return the correct g-index for the current fork
version.

Data structures used by the Ethereum client did not change in this
hard-fork. The BeaconState container has been updated with additional
changes, but because the on-chain code does not reference the
BeaconState directly (only indirectly through merkle proofs), it is not
a concern. Off-chain relayers use the BeaconState to generate proofs,
and so the relayer code has been updated accordingly.

### Companion PR for off-chain relayers
Snowfork/snowbridge#1283

---------

Co-authored-by: claravanstaden <Cats 4 life!>
Co-authored-by: Ron <yrong1997@gmail.com>
Co-authored-by: Vincent Geddes <vincent@snowfork.com>
Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>
Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
(cherry picked from commit dd7562a)
girazoki pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Feb 27, 2025
Adds support for the upcoming Ethereum Electra upgrade, while
maintaining backwards compatibility for the current Deneb fork.

Relayers should be updated to send updated Electra consensus data
structures.

The [Ethereum Electra hard-fork
consensus](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/light-client/sync-protocol.md)
changes affecting the Ethereum light client are mainly isolated to the
[Generalized
Indexes](https://github.com/protolambda/eth2.0-ssz/blob/master/specs/navigation/generalized_indices.md)
of data structures changing. Before Electra, these values were hardcoded
in config. For Electra, these values change and needed to the updated.
Methods were added to return the correct g-index for the current fork
version.

Data structures used by the Ethereum client did not change in this
hard-fork. The BeaconState container has been updated with additional
changes, but because the on-chain code does not reference the
BeaconState directly (only indirectly through merkle proofs), it is not
a concern. Off-chain relayers use the BeaconState to generate proofs,
and so the relayer code has been updated accordingly.

Snowfork/snowbridge#1283

---------

Co-authored-by: claravanstaden <Cats 4 life!>
Co-authored-by: Ron <yrong1997@gmail.com>
Co-authored-by: Vincent Geddes <vincent@snowfork.com>
Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>
Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
girazoki pushed a commit to moondance-labs/snowbridge that referenced this pull request Feb 28, 2025
* electra upgrade

* relayer progress

* more electra work

* fix config

* fixes

* fix tests

* update go version

* containers

* electra changes

* try testing lodestar + electra

* revert local script

* mekong network setup

* electra updates

* fixes

* fixes

* fix tests

* electra local net

* fix config

* cleanup

* fixes

* progress

* fix execution header proof

* revert testing changes

* adds tests

* cleanup

* cleanup

* uses geth binary instead of docker

* removes all traces of capella

* devnet6 fixes

* update bindings
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Mar 3, 2025
Adds support for the upcoming Ethereum Electra upgrade, while
maintaining backwards compatibility for the current Deneb fork.

Relayers should be updated to send updated Electra consensus data
structures.

The [Ethereum Electra hard-fork
consensus](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/light-client/sync-protocol.md)
changes affecting the Ethereum light client are mainly isolated to the
[Generalized
Indexes](https://github.com/protolambda/eth2.0-ssz/blob/master/specs/navigation/generalized_indices.md)
of data structures changing. Before Electra, these values were hardcoded
in config. For Electra, these values change and needed to the updated.
Methods were added to return the correct g-index for the current fork
version.

Data structures used by the Ethereum client did not change in this
hard-fork. The BeaconState container has been updated with additional
changes, but because the on-chain code does not reference the
BeaconState directly (only indirectly through merkle proofs), it is not
a concern. Off-chain relayers use the BeaconState to generate proofs,
and so the relayer code has been updated accordingly.

Snowfork/snowbridge#1283

---------

Co-authored-by: claravanstaden <Cats 4 life!>
Co-authored-by: Ron <yrong1997@gmail.com>
Co-authored-by: Vincent Geddes <vincent@snowfork.com>
Co-authored-by: Alistair Singh <alistair.singh7@gmail.com>
Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
gonzamontiel pushed a commit to datahaven-xyz/snowbridge that referenced this pull request May 22, 2025
* electra upgrade

* relayer progress

* more electra work

* fix config

* fixes

* fix tests

* update go version

* containers

* electra changes

* try testing lodestar + electra

* revert local script

* mekong network setup

* electra updates

* fixes

* fixes

* fix tests

* electra local net

* fix config

* cleanup

* fixes

* progress

* fix execution header proof

* revert testing changes

* adds tests

* cleanup

* cleanup

* uses geth binary instead of docker

* removes all traces of capella

* devnet6 fixes

* update bindings
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.

3 participants