Skip to content

Commit

Permalink
Update ExecutionPayload to have Milliseconds field, and initial commi…
Browse files Browse the repository at this point in the history
…t for adding Milliseconds to PayloadAttributes struct
  • Loading branch information
fahimahmedx committed Jul 24, 2024
1 parent 3dd0f54 commit 61e534e
Show file tree
Hide file tree
Showing 21 changed files with 57 additions and 27 deletions.
16 changes: 10 additions & 6 deletions op-conductor/conductor/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,14 @@ func (s *OpConductorTestSuite) TestScenario2() {
// [follower, healthy, not sequencing] -- become leader --> [leader, healthy, sequencing]
func (s *OpConductorTestSuite) TestScenario3() {
s.enableSynchronization()
timestamp := hexutil.Uint64(time.Now().Unix())

mockPayload := &eth.ExecutionPayloadEnvelope{
ExecutionPayload: &eth.ExecutionPayload{
BlockNumber: 1,
Timestamp: hexutil.Uint64(time.Now().Unix()),
BlockHash: [32]byte{1, 2, 3},
BlockNumber: 1,
Timestamp: timestamp,
BlockHash: [32]byte{1, 2, 3},
Milliseconds: timestamp * 1000,
},
}

Expand Down Expand Up @@ -419,14 +421,16 @@ func (s *OpConductorTestSuite) TestScenario3() {
// [follower, healthy, not sequencing] -- become leader, unsafe head does not match, retry, eventually succeed --> [leader, healthy, sequencing]
func (s *OpConductorTestSuite) TestScenario4() {
s.enableSynchronization()
timestamp := hexutil.Uint64(time.Now().Unix())

// unsafe in consensus is 1 block ahead of unsafe in sequencer, we try to post the unsafe payload to sequencer and return error to allow retry
// this is normal because the latest unsafe (in consensus) might not arrive at sequencer through p2p yet
mockPayload := &eth.ExecutionPayloadEnvelope{
ExecutionPayload: &eth.ExecutionPayload{
BlockNumber: 2,
Timestamp: hexutil.Uint64(time.Now().Unix()),
BlockHash: [32]byte{1, 2, 3},
BlockNumber: 2,
Timestamp: timestamp,
BlockHash: [32]byte{1, 2, 3},
Milliseconds: timestamp * 1000,
},
}

Expand Down
5 changes: 4 additions & 1 deletion op-conductor/consensus/raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func TestCommitAndRead(t *testing.T) {
Timestamp: hexutil.Uint64(now - 20),
Transactions: []eth.Data{},
ExtraData: []byte{},
Milliseconds: hexutil.Uint64((now - 20).ToMilliseconds()),
},
}

Expand All @@ -54,16 +55,18 @@ func TestCommitAndRead(t *testing.T) {
// eth.BlockV3
one := hexutil.Uint64(1)
hash := common.HexToHash("0x12345")
timestamp := hexutil.Uint64(time.Now().Unix())
payload = &eth.ExecutionPayloadEnvelope{
ParentBeaconBlockRoot: &hash,
ExecutionPayload: &eth.ExecutionPayload{
BlockNumber: 2,
Timestamp: hexutil.Uint64(time.Now().Unix()),
Timestamp: timestamp,
Transactions: []eth.Data{},
ExtraData: []byte{},
Withdrawals: &types.Withdrawals{},
ExcessBlobGas: &one,
BlobGasUsed: &one,
Milliseconds: timestamp * 1000,
},
}

Expand Down
2 changes: 1 addition & 1 deletion op-e2e/op_geth.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (d *OpGeth) StartBlockBuilding(ctx context.Context, attrs *eth.PayloadAttri

// CreatePayloadAttributes creates a valid PayloadAttributes containing a L1Info deposit transaction followed by the supplied transactions.
func (d *OpGeth) CreatePayloadAttributes(txs ...*types.Transaction) (*eth.PayloadAttributes, error) {
timestamp := timeint.FromHexUint64SecToSec(d.L2Head.Timestamp + 2)
timestamp := timeint.FromHexUint64MilliToMilli(d.L2Head.Milliseconds + 2*1000) // assumes two second blocktimes
l1Info, err := derive.L1InfoDepositBytes(d.l2Engine.RollupConfig(), d.SystemConfig, d.sequenceNum, d.L1Head, timestamp.ToMilliseconds())
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions op-node/p2p/gossip.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@ func (p *publisher) PublishL2Payload(ctx context.Context, envelope *eth.Executio
// This also copies the data, freeing up the original buffer to go back into the pool
out := snappy.Encode(nil, data)

if p.cfg.IsEcotone(timeint.FromHexUint64SecToMilli(envelope.ExecutionPayload.Timestamp)) {
if p.cfg.IsEcotone(timeint.FromHexUint64MilliToMilli(envelope.ExecutionPayload.Milliseconds)) {
return p.blocksV3.topic.Publish(ctx, out)
} else if p.cfg.IsCanyon(timeint.FromHexUint64SecToMilli(envelope.ExecutionPayload.Timestamp)) {
} else if p.cfg.IsCanyon(timeint.FromHexUint64MilliToMilli(envelope.ExecutionPayload.Milliseconds)) {
return p.blocksV2.topic.Publish(ctx, out)
} else {
return p.blocksV1.topic.Publish(ctx, out)
Expand Down
4 changes: 3 additions & 1 deletion op-node/p2p/gossip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ func createSignedP2Payload(payload MarshalSSZ, signer Signer, l2ChainID *big.Int
}

func createExecutionPayload(w types.Withdrawals, excessGas, gasUsed *uint64) *eth.ExecutionPayload {
timestamp := hexutil.Uint64(time.Now().Unix())
return &eth.ExecutionPayload{
Timestamp: hexutil.Uint64(time.Now().Unix()),
Timestamp: timestamp,
Withdrawals: &w,
ExcessBlobGas: (*eth.Uint64Quantity)(excessGas),
BlobGasUsed: (*eth.Uint64Quantity)(gasUsed),
Milliseconds: timestamp * 1000,
}
}

Expand Down
2 changes: 1 addition & 1 deletion op-node/p2p/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ func (srv *ReqRespServer) handleSyncRequest(ctx context.Context, stream network.

w := snappy.NewBufferedWriter(stream)

if srv.cfg.IsEcotone(timeint.FromHexUint64SecToMilli(envelope.ExecutionPayload.Timestamp)) {
if srv.cfg.IsEcotone(timeint.FromHexUint64MilliToMilli(envelope.ExecutionPayload.Milliseconds)) {
// 0 - resultCode: success = 0
// 1:5 - version: 1 (little endian)
tmp := [5]byte{0, 1, 0, 0, 0}
Expand Down
12 changes: 7 additions & 5 deletions op-node/p2p/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (s *syncTestData) getBlockRef(i uint64) eth.L2BlockRef {
Hash: s.payloads[i].ExecutionPayload.BlockHash,
Number: uint64(s.payloads[i].ExecutionPayload.BlockNumber),
ParentHash: s.payloads[i].ExecutionPayload.ParentHash,
Time: timeint.FromHexUint64SecToMilli(s.payloads[i].ExecutionPayload.Timestamp),
Time: timeint.FromHexUint64MilliToMilli(s.payloads[i].ExecutionPayload.Milliseconds),
}
}

Expand All @@ -90,7 +90,8 @@ func setupSyncTestData(length uint64) (*rollup.Config, *syncTestData) {
payloads := make(map[uint64]*eth.ExecutionPayloadEnvelope)
payloads[0] = &eth.ExecutionPayloadEnvelope{
ExecutionPayload: &eth.ExecutionPayload{
Timestamp: eth.Uint64Quantity(cfg.Genesis.L2Time.ToSeconds()),
Timestamp: eth.Uint64Quantity(cfg.Genesis.L2Time.ToSeconds()),
Milliseconds: eth.Uint64Quantity(cfg.Genesis.L2Time),
},
}

Expand All @@ -99,9 +100,10 @@ func setupSyncTestData(length uint64) (*rollup.Config, *syncTestData) {
timestamp := cfg.Genesis.L2Time + cfg.BlockTime.MultiplyInt(i)
payload := &eth.ExecutionPayloadEnvelope{
ExecutionPayload: &eth.ExecutionPayload{
ParentHash: payloads[i-1].ExecutionPayload.BlockHash,
BlockNumber: eth.Uint64Quantity(i),
Timestamp: eth.Uint64Quantity(timestamp.ToSeconds()),
ParentHash: payloads[i-1].ExecutionPayload.BlockHash,
BlockNumber: eth.Uint64Quantity(i),
Timestamp: eth.Uint64Quantity(timestamp.ToSeconds()),
Milliseconds: eth.Uint64Quantity(timestamp),
},
}

Expand Down
2 changes: 2 additions & 0 deletions op-node/rollup/attributes/attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func TestAttributesHandler(t *testing.T) {
BaseFeePerGas: eth.Uint256Quantity(*uint256.NewInt(7)),
BlockHash: common.Hash{},
Transactions: []eth.Data{a1L1Info},
Milliseconds: eth.Uint64Quantity(refA0.Time + cfg.BlockTime),
}, ParentBeaconBlockRoot: &parentBeaconBlockRoot}
// fix up the block-hash
payloadA1.ExecutionPayload.BlockHash, _ = payloadA1.CheckBlockHash()
Expand Down Expand Up @@ -140,6 +141,7 @@ func TestAttributesHandler(t *testing.T) {
BaseFeePerGas: eth.Uint256Quantity(*uint256.NewInt(7)),
BlockHash: common.Hash{},
Transactions: []eth.Data{a1L1Info},
Milliseconds: eth.Uint64Quantity(refA0.Time + cfg.BlockTime),
}, ParentBeaconBlockRoot: &parentBeaconBlockRoot}
// fix up the block-hash
payloadA1Alt.ExecutionPayload.BlockHash, _ = payloadA1Alt.CheckBlockHash()
Expand Down
2 changes: 1 addition & 1 deletion op-node/rollup/attributes/engine_consolidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func AttributesMatchBlock(rollupCfg *rollup.Config, attrs *eth.PayloadAttributes
for i, otx := range attrs.Transactions {
if expect := block.Transactions[i]; !bytes.Equal(otx, expect) {
if i == 0 {
logL1InfoTxns(rollupCfg, l, uint64(block.BlockNumber), timeint.FromHexUint64SecToMilli(block.Timestamp), otx, block.Transactions[i])
logL1InfoTxns(rollupCfg, l, uint64(block.BlockNumber), timeint.FromHexUint64MilliToMilli(block.Milliseconds), otx, block.Transactions[i])
}
return fmt.Errorf("transaction %d does not match. expected: %v. got: %v", i, expect, otx)
}
Expand Down
1 change: 1 addition & 0 deletions op-node/rollup/attributes/engine_consolidate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func ecotoneArgs() args {
GasLimit: validGasLimit,
Withdrawals: &validWithdrawals,
FeeRecipient: validFeeRecipient,
Milliseconds: validTimestamp * 1000,
},
},
attrs: &eth.PayloadAttributes{
Expand Down
2 changes: 2 additions & 0 deletions op-node/rollup/clsync/clsync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func TestCLSync(t *testing.T) {
BaseFeePerGas: eth.Uint256Quantity(*uint256.NewInt(7)),
BlockHash: refA1.Hash,
Transactions: []eth.Data{a1L1Info},
Milliseconds: eth.Uint64Quantity(refA1.Time),
}}
a2L1Info, err := derive.L1InfoDepositBytes(cfg, cfg.Genesis.SystemConfig, refA2.SequenceNumber, aL1Info, refA2.Time)
require.NoError(t, err)
Expand All @@ -120,6 +121,7 @@ func TestCLSync(t *testing.T) {
BaseFeePerGas: eth.Uint256Quantity(*uint256.NewInt(7)),
BlockHash: refA2.Hash,
Transactions: []eth.Data{a2L1Info},
Milliseconds: eth.Uint64Quantity(refA2.Time),
}}

metrics := &testutils.TestDerivationMetrics{}
Expand Down
1 change: 1 addition & 0 deletions op-node/rollup/derive/batch_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func singularBatchToPayload(t *testing.T, batch *SingularBatch, blockNumber uint
BlockNumber: hexutil.Uint64(blockNumber),
Timestamp: hexutil.Uint64(batch.Timestamp),
Transactions: txs,
Milliseconds: hexutil.Uint64(batch.Timestamp.ToMilliseconds()),
},
}
}
Expand Down
3 changes: 3 additions & 0 deletions op-node/rollup/derive/batches_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,7 @@ func TestValidBatch(t *testing.T) {
Timestamp: hexutil.Uint64(l2Block.Time.ToSeconds()),
BlockHash: l2Block.Hash,
Transactions: []hexutil.Bytes{txData},
Milliseconds: hexutil.Uint64(l2Block.Time),
},
}
l2Client.Mock.On("L2BlockRefByNumber", l2Block.Number).Return(l2Block, &nilErr)
Expand Down Expand Up @@ -1631,6 +1632,7 @@ func TestValidBatch(t *testing.T) {
Timestamp: hexutil.Uint64(l2B1.Time.ToSeconds()),
BlockHash: l2B1.Hash,
Transactions: []hexutil.Bytes{txData, randTxData},
Milliseconds: hexutil.Uint64(l2B1.Time),
},
}
l2Client.Mock.On("PayloadByNumber", l2B1.Number).Return(&payload, &nilErr).Once()
Expand Down Expand Up @@ -1678,6 +1680,7 @@ func TestValidBatch(t *testing.T) {
BlockHash: l2B1.Hash,
// First TX is not a deposit TX. it will make error when extracting L2BlockRef from the payload
Transactions: []hexutil.Bytes{randTxData},
Milliseconds: hexutil.Uint64(l2B1.Time),
},
}
l2Client.Mock.On("PayloadByNumber", l2B1.Number).Return(&payload, &nilErr).Once()
Expand Down
8 changes: 4 additions & 4 deletions op-node/rollup/derive/payload_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func PayloadToBlockRef(rollupCfg *rollup.Config, payload *eth.ExecutionPayload)
if tx.Type() != types.DepositTxType {
return eth.L2BlockRef{}, fmt.Errorf("first payload tx has unexpected tx type: %d", tx.Type())
}
info, err := L1BlockInfoFromBytes(rollupCfg, timeint.FromHexUint64SecToMilli(payload.Timestamp), tx.Data())
info, err := L1BlockInfoFromBytes(rollupCfg, timeint.FromHexUint64MilliToMilli(payload.Milliseconds), tx.Data())
if err != nil {
return eth.L2BlockRef{}, fmt.Errorf("failed to parse L1 info deposit tx from L2 block: %w", err)
}
Expand All @@ -46,7 +46,7 @@ func PayloadToBlockRef(rollupCfg *rollup.Config, payload *eth.ExecutionPayload)
Hash: payload.BlockHash,
Number: uint64(payload.BlockNumber),
ParentHash: payload.ParentHash,
Time: timeint.FromHexUint64SecToMilli(payload.Timestamp),
Time: timeint.FromHexUint64MilliToMilli(payload.Milliseconds),
L1Origin: l1Origin,
SequenceNumber: sequenceNumber,
}, nil
Expand All @@ -71,11 +71,11 @@ func PayloadToSystemConfig(rollupCfg *rollup.Config, payload *eth.ExecutionPaylo
if tx.Type() != types.DepositTxType {
return eth.SystemConfig{}, fmt.Errorf("first payload tx has unexpected tx type: %d", tx.Type())
}
info, err := L1BlockInfoFromBytes(rollupCfg, timeint.FromHexUint64SecToMilli(payload.Timestamp), tx.Data())
info, err := L1BlockInfoFromBytes(rollupCfg, timeint.FromHexUint64MilliToMilli(payload.Milliseconds), tx.Data())
if err != nil {
return eth.SystemConfig{}, fmt.Errorf("failed to parse L1 info deposit tx from L2 block: %w", err)
}
if isEcotoneButNotFirstBlock(rollupCfg, timeint.FromHexUint64SecToMilli(payload.Timestamp)) {
if isEcotoneButNotFirstBlock(rollupCfg, timeint.FromHexUint64MilliToMilli(payload.Milliseconds)) {
// Translate Ecotone values back into encoded scalar if needed.
// We do not know if it was derived from a v0 or v1 scalar,
// but v1 is fine, a 0 blob base fee has the same effect.
Expand Down
3 changes: 2 additions & 1 deletion op-node/rollup/sequencing/sequencer_chaos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func (c *ChaoticEngine) OnEvent(ev event.Event) bool {
BlockHash: testutils.RandomHash(c.rng),
Timestamp: c.currentAttributes.Attributes.Timestamp,
Transactions: c.currentAttributes.Attributes.Transactions,
Milliseconds: c.currentAttributes.Attributes.Milliseconds,
// Not all attributes matter to sequencer. We can leave these nil.
},
}
Expand All @@ -173,7 +174,7 @@ func (c *ChaoticEngine) OnEvent(ev event.Event) bool {
Hash: payloadEnvelope.ExecutionPayload.BlockHash,
Number: uint64(payloadEnvelope.ExecutionPayload.BlockNumber),
ParentHash: payloadEnvelope.ExecutionPayload.ParentHash,
Time: timeint.FromHexUint64SecToMilli(payloadEnvelope.ExecutionPayload.Timestamp),
Time: timeint.FromHexUint64MilliToMilli(payloadEnvelope.ExecutionPayload.Milliseconds),
L1Origin: l1Origin,
SequenceNumber: 0, // ignored
}
Expand Down
5 changes: 3 additions & 2 deletions op-node/rollup/sequencing/sequencer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,15 @@ func TestSequencerBuild(t *testing.T) {
BlockHash: common.Hash{0x12, 0x34},
Timestamp: sentAttributes.Attributes.Timestamp,
Transactions: sentAttributes.Attributes.Transactions,
Milliseconds: sentAttributes.Attributes.Milliseconds,
// Not all attributes matter to sequencer. We can leave these nil.
},
}
payloadRef := eth.L2BlockRef{
Hash: payloadEnvelope.ExecutionPayload.BlockHash,
Number: uint64(payloadEnvelope.ExecutionPayload.BlockNumber),
ParentHash: payloadEnvelope.ExecutionPayload.ParentHash,
Time: timeint.FromHexUint64SecToMilli(payloadEnvelope.ExecutionPayload.Timestamp),
Time: timeint.FromHexUint64MilliToMilli(payloadEnvelope.ExecutionPayload.Milliseconds),
L1Origin: l1Origin.ID(),
SequenceNumber: 0,
}
Expand Down Expand Up @@ -421,7 +422,7 @@ func createSequencer(log log.Logger) (*Sequencer, *sequencerTestDeps) {
Hash: payload.BlockHash,
Number: uint64(payload.BlockNumber),
ParentHash: payload.ParentHash,
Time: timeint.FromHexUint64SecToMilli(payload.Timestamp),
Time: timeint.FromHexUint64MilliToMilli(payload.Milliseconds),
L1Origin: decodeID(payload.Transactions[0]),
SequenceNumber: 0,
}, nil
Expand Down
2 changes: 1 addition & 1 deletion op-program/client/l2/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (o *OracleEngine) ForkchoiceUpdate(ctx context.Context, state *eth.Forkchoi
}

func (o *OracleEngine) NewPayload(ctx context.Context, payload *eth.ExecutionPayload, parentBeaconBlockRoot *common.Hash) (*eth.PayloadStatusV1, error) {
switch method := o.rollupCfg.NewPayloadVersion(timeint.FromHexUint64SecToMilli(payload.Timestamp)); method {
switch method := o.rollupCfg.NewPayloadVersion(timeint.FromHexUint64MilliToMilli(payload.Milliseconds)); method {
case eth.NewPayloadV3:
return o.api.NewPayloadV3(ctx, payload, []common.Hash{}, parentBeaconBlockRoot)
case eth.NewPayloadV2:
Expand Down
2 changes: 2 additions & 0 deletions op-program/client/l2/engineapi/test/l2_engine_api_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ func RunEngineAPITests(t *testing.T, createBackend func(t *testing.T) engineapi.

// Then make it invalid to check NewPayload rejects it
newBlock.Timestamp = eth.Uint64Quantity(genesis.Time)
newBlock.Milliseconds = eth.Uint64Quantity(genesis.Milliseconds)
updateBlockHash(envelope)

r, err := api.engine.NewPayloadV2(api.ctx, newBlock)
Expand All @@ -179,6 +180,7 @@ func RunEngineAPITests(t *testing.T, createBackend func(t *testing.T) engineapi.

// Then make it invalid to check NewPayload rejects it
newBlock.Timestamp = eth.Uint64Quantity(genesis.Time - 1)
newBlock.Milliseconds = eth.Uint64Quantity(genesis.Milliseconds - 1000)
updateBlockHash(envelope)

r, err := api.engine.NewPayloadV2(api.ctx, newBlock)
Expand Down
5 changes: 5 additions & 0 deletions op-service/eth/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ type ExecutionPayload struct {
BlobGasUsed *Uint64Quantity `json:"blobGasUsed,omitempty"`
// Nil if not present (Bedrock, Canyon, Delta)
ExcessBlobGas *Uint64Quantity `json:"excessBlobGas,omitempty"`
Milliseconds Uint64Quantity `json:"milliseconds"`
}

func (payload *ExecutionPayload) ID() BlockID {
Expand Down Expand Up @@ -247,6 +248,7 @@ func (envelope *ExecutionPayloadEnvelope) CheckBlockHash() (actual common.Hash,
Nonce: types.BlockNonce{}, // zeroed, proof-of-work legacy
BaseFee: (*uint256.Int)(&payload.BaseFeePerGas).ToBig(),
ParentBeaconRoot: envelope.ParentBeaconBlockRoot,
Milliseconds: uint64(payload.Milliseconds),
}

if payload.CanyonBlock() {
Expand Down Expand Up @@ -289,6 +291,7 @@ func BlockAsPayload(bl *types.Block, canyonForkTime *timeint.Seconds) (*Executio
Transactions: opaqueTxs,
ExcessBlobGas: (*Uint64Quantity)(bl.ExcessBlobGas()),
BlobGasUsed: (*Uint64Quantity)(bl.BlobGasUsed()),
Milliseconds: Uint64Quantity(bl.Milliseconds()),
}

if canyonForkTime != nil && timeint.FromHexUint64SecToSec(payload.Timestamp) >= *canyonForkTime {
Expand Down Expand Up @@ -329,6 +332,8 @@ type PayloadAttributes struct {
NoTxPool bool `json:"noTxPool,omitempty"`
// GasLimit override
GasLimit *Uint64Quantity `json:"gasLimit,omitempty"`
// value for the timestamp field of the new payload in milliseconds
Milliseconds Uint64Quantity `json:"milliseconds"`
}

type ExecutePayloadStatus string
Expand Down
2 changes: 1 addition & 1 deletion op-service/sources/engine_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (s *EngineAPIClient) NewPayload(ctx context.Context, payload *eth.Execution
var result eth.PayloadStatusV1

var err error
switch method := s.evp.NewPayloadVersion(timeint.FromHexUint64SecToMilli(payload.Timestamp)); method {
switch method := s.evp.NewPayloadVersion(timeint.FromHexUint64MilliToMilli(payload.Milliseconds)); method {
case eth.NewPayloadV3:
err = s.RPC.CallContext(execCtx, &result, string(method), payload, []common.Hash{}, parentBeaconBlockRoot)
case eth.NewPayloadV2:
Expand Down
1 change: 1 addition & 0 deletions op-service/sources/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ func (block *RPCBlock) ExecutionPayloadEnvelope(trustCache bool) (*eth.Execution
Withdrawals: block.Withdrawals,
BlobGasUsed: block.BlobGasUsed,
ExcessBlobGas: block.ExcessBlobGas,
Milliseconds: block.Milliseconds,
}

return &eth.ExecutionPayloadEnvelope{
Expand Down

0 comments on commit 61e534e

Please sign in to comment.