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

feat(primitives): Create our own custom execution types #1856

Merged
merged 23 commits into from
Aug 7, 2024
2 changes: 1 addition & 1 deletion beacond/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ require (
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions beacond/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 h1:lC8kiphgdOBTcbTvo8MwkvpKjO0SlAgjv4xIK5FGJ94=
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15/go.mod h1:8svFBIKKu31YriBG/pNizo9N0Jr9i5PQ+dFkxWg3x5k=
github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4=
github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs=
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b h1:VK7thFOnhxAZ/5aolr5Os4beiubuD08WiuiHyRqgwks=
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b/go.mod h1:HRuvtXLZ4WkaB1MItToVH2e8ZwKwZPY5/Rcby+CvvLY=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
Expand Down
1 change: 1 addition & 0 deletions build/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ require (
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b // indirect
github.com/quasilyte/go-ruleguard v0.4.2 // indirect
github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect
github.com/quasilyte/gogrep v0.5.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions build/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G
github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4=
github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs=
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b h1:VK7thFOnhxAZ/5aolr5Os4beiubuD08WiuiHyRqgwks=
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b/go.mod h1:HRuvtXLZ4WkaB1MItToVH2e8ZwKwZPY5/Rcby+CvvLY=
github.com/quasilyte/go-ruleguard v0.4.2 h1:htXcXDK6/rO12kiTHKfHuqR4kr3Y4M0J0rOL6CH/BYs=
github.com/quasilyte/go-ruleguard v0.4.2/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI=
github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE=
Expand Down
2 changes: 1 addition & 1 deletion kurtosis/src/nodes/jwt-secret.hex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1b8d34037ac04570b76cb1a13d1db17729a5b6a90f10497b2bc4422fbd39615a
0x1b8d34037ac04570b76cb1a13d1db17729a5b6a90f10497b2bc4422fbd39615a
5 changes: 2 additions & 3 deletions mod/beacon/blockchain/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"sync"

asynctypes "github.com/berachain/beacon-kit/mod/async/pkg/types"
gethprimitives "github.com/berachain/beacon-kit/mod/geth-primitives"
"github.com/berachain/beacon-kit/mod/log"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/events"
Expand All @@ -48,7 +47,7 @@ type Service[
PayloadAttributesT interface {
IsNil() bool
Version() uint32
GetSuggestedFeeRecipient() gethprimitives.ExecutionAddress
GetSuggestedFeeRecipient() common.ExecutionAddress
},
WithdrawalT any,
] struct {
Expand Down Expand Up @@ -108,7 +107,7 @@ func NewService[
PayloadAttributesT interface {
IsNil() bool
Version() uint32
GetSuggestedFeeRecipient() gethprimitives.ExecutionAddress
GetSuggestedFeeRecipient() common.ExecutionAddress
},
WithdrawalT any,
](
Expand Down
11 changes: 5 additions & 6 deletions mod/beacon/blockchain/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"time"

engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives"
gethprimitives "github.com/berachain/beacon-kit/mod/geth-primitives"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/constraints"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
Expand Down Expand Up @@ -91,7 +90,7 @@ type ExecutionEngine[PayloadAttributesT any] interface {
NotifyForkchoiceUpdate(
ctx context.Context,
req *engineprimitives.ForkchoiceUpdateRequest[PayloadAttributesT],
) (*engineprimitives.PayloadID, *gethprimitives.ExecutionHash, error)
) (*engineprimitives.PayloadID, *common.ExecutionHash, error)
}

// EventFeed is a generic interface for sending events.
Expand All @@ -112,9 +111,9 @@ type ExecutionPayloadHeader interface {
// GetTimestamp returns the timestamp.
GetTimestamp() math.U64
// GetBlockHash returns the block hash.
GetBlockHash() gethprimitives.ExecutionHash
GetBlockHash() common.ExecutionHash
// GetParentHash returns the parent hash.
GetParentHash() gethprimitives.ExecutionHash
GetParentHash() common.ExecutionHash
}

// Genesis is the interface for the genesis.
Expand All @@ -138,8 +137,8 @@ type LocalBuilder[BeaconStateT any] interface {
slot math.Slot,
timestamp uint64,
parentBlockRoot common.Root,
headEth1BlockHash gethprimitives.ExecutionHash,
finalEth1BlockHash gethprimitives.ExecutionHash,
headEth1BlockHash common.ExecutionHash,
finalEth1BlockHash common.ExecutionHash,
) (*engineprimitives.PayloadID, error)
// SendForceHeadFCU sends a force head FCU request.
SendForceHeadFCU(
Expand Down
4 changes: 2 additions & 2 deletions mod/beacon/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
github.com/berachain/beacon-kit/mod/async v0.0.0-20240618214413-d5ec0e66b3dd
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240610210054-bfdc14c4013c
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240618214413-d5ec0e66b3dd
github.com/berachain/beacon-kit/mod/geth-primitives v0.0.0-20240806160829-cde2d1347e7e
github.com/berachain/beacon-kit/mod/log v0.0.0-20240610210054-bfdc14c4013c
github.com/berachain/beacon-kit/mod/primitives v0.0.0-20240806160829-cde2d1347e7e
golang.org/x/sync v0.8.0
Expand All @@ -20,6 +19,7 @@ require (
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240703145037-b5612ab256db // indirect
github.com/berachain/beacon-kit/mod/geth-primitives v0.0.0-20240806160829-cde2d1347e7e // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
Expand Down Expand Up @@ -64,7 +64,7 @@ require (
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
Expand Down
4 changes: 2 additions & 2 deletions mod/beacon/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 h1:lC8kiphgdOBTcbTvo8MwkvpKjO0SlAgjv4xIK5FGJ94=
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15/go.mod h1:8svFBIKKu31YriBG/pNizo9N0Jr9i5PQ+dFkxWg3x5k=
github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4=
github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs=
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b h1:VK7thFOnhxAZ/5aolr5Os4beiubuD08WiuiHyRqgwks=
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b/go.mod h1:HRuvtXLZ4WkaB1MItToVH2e8ZwKwZPY5/Rcby+CvvLY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand Down
5 changes: 2 additions & 3 deletions mod/beacon/validator/block_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (

engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives"
"github.com/berachain/beacon-kit/mod/errors"
gethprimitives "github.com/berachain/beacon-kit/mod/geth-primitives"
"github.com/berachain/beacon-kit/mod/primitives/pkg/bytes"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/crypto"
Expand Down Expand Up @@ -306,9 +305,9 @@ func (s *Service[
var eth1Data Eth1DataT
// TODO: assemble real eth1data.
body.SetEth1Data(eth1Data.New(
common.Bytes32{},
common.Root{},
0,
gethprimitives.ZeroHash,
common.ExecutionHash{},
))

// Set the graffiti on the block body.
Expand Down
13 changes: 6 additions & 7 deletions mod/beacon/validator/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"time"

engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives"
gethprimitives "github.com/berachain/beacon-kit/mod/geth-primitives"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/constraints"
"github.com/berachain/beacon-kit/mod/primitives/pkg/crypto"
Expand Down Expand Up @@ -88,7 +87,7 @@ type BeaconBlockBody[
SetSlashingInfo([]SlashingInfoT)
// SetBlobKzgCommitments sets the blob KZG commitments of the beacon block
// body.
SetBlobKzgCommitments(eip4844.KZGCommitments[gethprimitives.ExecutionHash])
SetBlobKzgCommitments(eip4844.KZGCommitments[common.ExecutionHash])
}

// BeaconState represents a beacon state interface.
Expand Down Expand Up @@ -151,7 +150,7 @@ type Eth1Data[T any] interface {
New(
depositRoot common.Root,
depositCount math.U64,
blockHash gethprimitives.ExecutionHash,
blockHash common.ExecutionHash,
) T
}

Expand All @@ -160,9 +159,9 @@ type ExecutionPayloadHeader interface {
// GetTimestamp returns the timestamp of the execution payload header.
GetTimestamp() math.U64
// GetBlockHash returns the block hash of the execution payload header.
GetBlockHash() gethprimitives.ExecutionHash
GetBlockHash() common.ExecutionHash
// GetParentHash returns the parent hash of the execution payload header.
GetParentHash() gethprimitives.ExecutionHash
GetParentHash() common.ExecutionHash
}

// EventSubscription represents the event subscription interface.
Expand Down Expand Up @@ -205,8 +204,8 @@ type PayloadBuilder[BeaconStateT, ExecutionPayloadT any] interface {
slot math.Slot,
timestamp uint64,
parentBlockRoot common.Root,
headEth1BlockHash gethprimitives.ExecutionHash,
finalEth1BlockHash gethprimitives.ExecutionHash,
headEth1BlockHash common.ExecutionHash,
finalEth1BlockHash common.ExecutionHash,
) (engineprimitives.BuiltExecutionPayloadEnv[ExecutionPayloadT], error)
}

Expand Down
2 changes: 1 addition & 1 deletion mod/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ require (
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions mod/cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 h1:lC8kiphgdOBTcbTvo8MwkvpKjO0SlAgjv4xIK5FGJ94=
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15/go.mod h1:8svFBIKKu31YriBG/pNizo9N0Jr9i5PQ+dFkxWg3x5k=
github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4=
github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs=
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b h1:VK7thFOnhxAZ/5aolr5Os4beiubuD08WiuiHyRqgwks=
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b/go.mod h1:HRuvtXLZ4WkaB1MItToVH2e8ZwKwZPY5/Rcby+CvvLY=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
Expand Down
6 changes: 3 additions & 3 deletions mod/cli/pkg/commands/deposit/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func broadcastDepositTx[

// Send the deposit to the deposit contract through abi bindings.
depositContract, err := deposit.NewBeaconDepositContract(
chainSpec.DepositContractAddress(),
gethprimitives.ExecutionAddress(chainSpec.DepositContractAddress()),
ethClient,
)
if err != nil {
Expand All @@ -232,7 +232,7 @@ func broadcastDepositTx[
&bind.TransactOpts{
From: gethprimitivescrypto.PubkeyToAddress(privKey.PublicKey),
Signer: func(
_ common.ExecutionAddress, tx *gethprimitives.Transaction,
_ gethprimitives.ExecutionAddress, tx *gethprimitives.Transaction,
) (*gethprimitives.Transaction, error) {
return gethprimitives.SignTx(
tx,
Expand Down Expand Up @@ -275,7 +275,7 @@ func broadcastDepositTx[
)
}

return depositReceipt.TxHash, nil
return common.ExecutionHash(depositReceipt.TxHash), nil
}

// getBLSSigner returns a BLS signer based on the override commands key flag.
Expand Down
3 changes: 1 addition & 2 deletions mod/cli/pkg/commands/genesis/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/berachain/beacon-kit/mod/cli/pkg/utils/parser"
"github.com/berachain/beacon-kit/mod/consensus-types/pkg/types"
"github.com/berachain/beacon-kit/mod/errors"
gethprimitives "github.com/berachain/beacon-kit/mod/geth-primitives"
"github.com/berachain/beacon-kit/mod/node-core/pkg/components"
"github.com/berachain/beacon-kit/mod/node-core/pkg/components/signer"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
Expand Down Expand Up @@ -99,7 +98,7 @@ func AddGenesisDepositCmd(cs common.ChainSpec) *cobra.Command {
blsSigner,
// TODO: configurable.
types.NewCredentialsFromExecutionAddress(
gethprimitives.ExecutionAddress{},
common.ExecutionAddress{},
),
depositAmount,
Comment on lines +101 to 103
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Ensure replacement of gethprimitives.ExecutionAddress with common.ExecutionAddress in the following files:

  • testing/e2e/e2e_staking_test.go
  • mod/cli/pkg/commands/deposit/create.go
  • mod/execution/pkg/deposit/contract.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go

Please review these files and update the type usage as necessary.

Analysis chain

LGTM! But verify the usage of the new type in the codebase.

The change to use common.ExecutionAddress instead of gethprimitives.ExecutionAddress aligns with the PR objectives.

However, ensure that all instances of gethprimitives.ExecutionAddress have been replaced with common.ExecutionAddress throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instances of `gethprimitives.ExecutionAddress` have been replaced with `common.ExecutionAddress`.

# Test: Search for the old type usage. Expect: No occurrences of the old type.
rg --type go 'gethprimitives.ExecutionAddress'

Length of output: 687

)
Expand Down
6 changes: 3 additions & 3 deletions mod/cli/pkg/commands/genesis/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ func executableDataToExecutionPayloadHeader(
}

executionPayloadHeader = &types.ExecutionPayloadHeader{
ParentHash: data.ParentHash,
FeeRecipient: data.FeeRecipient,
ParentHash: common.ExecutionHash(data.ParentHash),
FeeRecipient: common.ExecutionAddress(data.FeeRecipient),
StateRoot: common.Bytes32(data.StateRoot),
ReceiptsRoot: common.Bytes32(data.ReceiptsRoot),
LogsBloom: [256]byte(data.LogsBloom),
Expand All @@ -176,7 +176,7 @@ func executableDataToExecutionPayloadHeader(
Timestamp: math.U64(data.Timestamp),
ExtraData: data.ExtraData,
BaseFeePerGas: math.NewU256FromBigInt(data.BaseFeePerGas),
BlockHash: data.BlockHash,
BlockHash: common.ExecutionHash(data.BlockHash),
// TODO: Decouple from broken bArtio.
TransactionsRoot: engineprimitives.
BartioTransactions(
Expand Down
4 changes: 2 additions & 2 deletions mod/config/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
github.com/berachain/beacon-kit/mod/da v0.0.0-20240610210054-bfdc14c4013c
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240705193247-d464364483df
github.com/berachain/beacon-kit/mod/execution v0.0.0-20240624003607-df94860f8eeb
github.com/berachain/beacon-kit/mod/geth-primitives v0.0.0-20240806160829-cde2d1347e7e
github.com/berachain/beacon-kit/mod/log v0.0.0-20240705193247-d464364483df
github.com/berachain/beacon-kit/mod/node-api v0.0.0-20240806160829-cde2d1347e7e
github.com/berachain/beacon-kit/mod/payload v0.0.0-20240624003607-df94860f8eeb
Expand All @@ -19,6 +18,7 @@ require (
)

require (
github.com/berachain/beacon-kit/mod/geth-primitives v0.0.0-20240806160829-cde2d1347e7e // indirect
github.com/cometbft/cometbft/api v1.0.0-rc.1.0.20240806094948-2c4293ef36c4 // indirect
github.com/cosmos/crypto v0.1.2 // indirect
)
Expand Down Expand Up @@ -97,7 +97,7 @@ require (
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions mod/config/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 h1:lC8kiphgdOBTcbTvo8MwkvpKjO0SlAgjv4xIK5FGJ94=
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15/go.mod h1:8svFBIKKu31YriBG/pNizo9N0Jr9i5PQ+dFkxWg3x5k=
github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4=
github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs=
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b h1:VK7thFOnhxAZ/5aolr5Os4beiubuD08WiuiHyRqgwks=
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b/go.mod h1:HRuvtXLZ4WkaB1MItToVH2e8ZwKwZPY5/Rcby+CvvLY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand Down
3 changes: 1 addition & 2 deletions mod/config/pkg/spec/devnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package spec

import (
"github.com/berachain/beacon-kit/mod/chain-spec/pkg/chain"
gethprimitives "github.com/berachain/beacon-kit/mod/geth-primitives"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
)
Expand All @@ -31,7 +30,7 @@ import (
func DevnetChainSpec() chain.Spec[
common.DomainType,
math.Epoch,
gethprimitives.ExecutionAddress,
common.ExecutionAddress,
math.Slot,
any,
] {
Expand Down
9 changes: 4 additions & 5 deletions mod/config/pkg/spec/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package spec

import (
"github.com/berachain/beacon-kit/mod/chain-spec/pkg/chain"
gethprimitives "github.com/berachain/beacon-kit/mod/geth-primitives"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/crypto"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
Expand All @@ -33,7 +32,7 @@ import (
func TestnetChainSpec() chain.Spec[
common.DomainType,
math.Epoch,
gethprimitives.ExecutionAddress,
common.ExecutionAddress,
math.Slot,
any,
] {
Expand All @@ -46,7 +45,7 @@ func TestnetChainSpec() chain.Spec[
func BaseSpec() chain.SpecData[
common.DomainType,
math.Epoch,
gethprimitives.ExecutionAddress,
common.ExecutionAddress,
math.Slot,
any,
] {
Expand All @@ -56,7 +55,7 @@ func BaseSpec() chain.SpecData[
return chain.SpecData[
common.DomainType,
math.Epoch,
gethprimitives.ExecutionAddress,
common.ExecutionAddress,
math.Slot,
any,
]{
Expand Down Expand Up @@ -95,7 +94,7 @@ func BaseSpec() chain.SpecData[
0x00, 0x00, 0x00, 0x01,
},
// Eth1-related values.
DepositContractAddress: gethprimitives.HexToAddress(
DepositContractAddress: common.NewExecutionAddressFromHex(
"0x4242424242424242424242424242424242424242",
),
DepositEth1ChainID: uint64(80084),
Expand Down
Loading
Loading