Skip to content

Commit

Permalink
Ecotone/Dencun implementation changes (ethereum-optimism#8707)
Browse files Browse the repository at this point in the history
* op-node: L2 Dencun implementation updates

init branch

Update reference to Eclipse/Ecotone in specs.

Pull in Danyal's deposit source and add additional tests.

Add notion of ParentBeaconRoot and build a contract deploy tx in attributes.go.

Add a test for activating dencun l2 fork after genesis.

Add draft ecotone setup.

Add first pass of Eclipse upgrade txns

Fix tests/compile

Code review feedback

Obey linter.

Move ecotone setup to helpers.go; get the ParentBeaconBlockRoot from the l1Info in attributes.go.

chore(op-node): Add tests for Ecotone deposit transactions (ethereum-optimism#8746)

* Source hash teEvanJRichard <[email protected]>

dencun review fixes

derive: ecotone upgradeTo abi encoding

op-e2e: test L2 exclusion of blob-txs in Ecotone

op-node/rollup: deduplicate ecotone activation helper func, fix rollup config var name

op-chain-ops: clarify 4788 contract nonce

op-node/rollup: add setEcotone to ecotone upgrade txs

dencun review fixes

Dencun: P2P / EngineAPI / ExecutionPayloadEnvelope changes

Includes:
- Pass through execution payload (Envelope type everywhere) by Danyal,
  extended by Proto
- Fix ecotone upgrade txns, by Danyal
- ci fixes by Danyal
- P2P Req/Resp (version based encoding/decoding) by Danyal
- EngineAPI v3 usage by Danyl, rebased by Proto on EngineController (from
  trianglesphere)
- Block v3 Gossip validation, by Danyal
- Block v3 Gossip publishing, by Proto

Rebased on updated Ecotone / Dencun base branch

op-e2e: fix upgrade-txs count in test

op-node: fix l1 info scalar migration, implement dencun review suggestions

op-node: more dencun review nit fixes

op-node: rabbit suggestions, but fixed

Fix nil pointer in p2p sync for Ecotone blocks

dencun: fix more nits

op-e2e: fix lint

Co-authored-by: Danyal Prout <[email protected]>
Co-authored-by: protolambda <[email protected]>
Co-authored-by: EvanJRichard <[email protected]>

* Add tests for attribute matching

* Provide a no-op blob fetcher to prevent derivation error

Fail tests when there is an unknown error

Fix typo / empty array to nil

Update L2 tests to ecotone / add additional checks

* op-e2e: dencun action-test setup fixes

* op-node: op-conductor dencun todo

* dencun: fix review nit about parent beacon block root gossip check style

---------

Co-authored-by: Danyal Prout <[email protected]>
Co-authored-by: protolambda <[email protected]>
  • Loading branch information
3 people authored Jan 18, 2024
1 parent cceb207 commit 705db87
Show file tree
Hide file tree
Showing 68 changed files with 1,699 additions and 540 deletions.
4 changes: 2 additions & 2 deletions op-bootnode/bootnode/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

type gossipNoop struct{}

func (g *gossipNoop) OnUnsafeL2Payload(_ context.Context, _ peer.ID, _ *eth.ExecutionPayload) error {
func (g *gossipNoop) OnUnsafeL2Payload(_ context.Context, _ peer.ID, _ *eth.ExecutionPayloadEnvelope) error {
return nil
}

Expand All @@ -36,7 +36,7 @@ func (g *gossipConfig) P2PSequencerAddress() common.Address {

type l2Chain struct{}

func (l *l2Chain) PayloadByNumber(_ context.Context, _ uint64) (*eth.ExecutionPayload, error) {
func (l *l2Chain) PayloadByNumber(_ context.Context, _ uint64) (*eth.ExecutionPayloadEnvelope, error) {
return nil, nil
}

Expand Down
4 changes: 2 additions & 2 deletions op-chain-ops/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
RegolithTime: config.RegolithTime(block.Time()),
CanyonTime: config.CanyonTime(block.Time()),
ShanghaiTime: config.CanyonTime(block.Time()),
EcotoneTime: config.EcotoneTime(block.Time()), // separate from Dencun, for Blob-fees support activation
CancunTime: nil, // no Dencun on L2 yet.
CancunTime: config.EcotoneTime(block.Time()),
EcotoneTime: config.EcotoneTime(block.Time()),
InteropTime: config.InteropTime(block.Time()),
Optimism: &params.OptimismConfig{
EIP1559Denominator: eip1559Denom,
Expand Down
43 changes: 31 additions & 12 deletions op-conductor/client/mocks/SequencerControl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions op-conductor/client/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type SequencerControl interface {
StopSequencer(ctx context.Context) (common.Hash, error)
SequencerActive(ctx context.Context) (bool, error)
LatestUnsafeBlock(ctx context.Context) (eth.BlockInfo, error)
PostUnsafePayload(ctx context.Context, payload *eth.ExecutionPayload) error
PostUnsafePayload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) error
}

// NewSequencerControl creates a new SequencerControl instance.
Expand Down Expand Up @@ -56,6 +56,6 @@ func (s *sequencerController) SequencerActive(ctx context.Context) (bool, error)
}

// PostUnsafePayload implements SequencerControl.
func (s *sequencerController) PostUnsafePayload(ctx context.Context, payload *eth.ExecutionPayload) error {
func (s *sequencerController) PostUnsafePayload(ctx context.Context, payload *eth.ExecutionPayloadEnvelope) error {
return s.node.PostUnsafePayload(ctx, payload)
}
4 changes: 3 additions & 1 deletion op-conductor/conductor/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,9 @@ func (oc *OpConductor) startSequencer() error {

if uint64(unsafeInCons.BlockNumber)-unsafeInNode.NumberU64() == 1 {
// tries to post the unsafe head to op-node when head is only 1 block behind (most likely due to gossip delay)
if err = oc.ctrl.PostUnsafePayload(context.Background(), unsafeInCons); err != nil {
// TODO(ethereum-optimism/optimism#9064): op-conductor Dencun changes.
envelope := &eth.ExecutionPayloadEnvelope{ExecutionPayload: unsafeInCons}
if err = oc.ctrl.PostUnsafePayload(context.Background(), envelope); err != nil {
oc.log.Error("failed to post unsafe head payload to op-node", "err", err)
}
}
Expand Down
63 changes: 57 additions & 6 deletions op-conductor/consensus/mocks/Consensus.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 17 additions & 6 deletions op-conductor/health/mocks/HealthMonitor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 705db87

Please sign in to comment.