Skip to content

Commit

Permalink
simulators/ethereum/engine,pyspec: Update Trusted Setup (ethereum#915)
Browse files Browse the repository at this point in the history
* simulators/ethereum/engine: Update geth branch, use mainnet trusted setup

* simulators/ethereum: go.work.sum

* simulators/ethereum/pyspec: Update geth branch

* configs/cancun: Update geth to devnet-10

* simulators/ethereum/engine: Send different blobs depending on the sender
  • Loading branch information
marioevz authored and Eikix committed Mar 1, 2024
1 parent e88d288 commit bc70996
Show file tree
Hide file tree
Showing 11 changed files with 4,343 additions and 111 deletions.
2 changes: 1 addition & 1 deletion configs/cancun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
dockerfile: git
build_args:
github: lightclient/go-ethereum
tag: devnet-9
tag: devnet-10

- client: nethermind
nametag: cancun-git
Expand Down
28 changes: 14 additions & 14 deletions simulators/ethereum/engine/devp2p/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,24 @@ func (msg Transactions) Code() int { return 18 }
func (msg Transactions) ReqID() uint64 { return 18 }

// GetBlockHeaders represents a block header query.
type GetBlockHeaders eth.GetBlockHeadersPacket66
type GetBlockHeaders eth.GetBlockHeadersPacket

func (msg GetBlockHeaders) Code() int { return 19 }
func (msg GetBlockHeaders) ReqID() uint64 { return msg.RequestId }

type BlockHeaders eth.BlockHeadersPacket66
type BlockHeaders eth.BlockHeadersPacket

func (msg BlockHeaders) Code() int { return 20 }
func (msg BlockHeaders) ReqID() uint64 { return msg.RequestId }

// GetBlockBodies represents a GetBlockBodies request
type GetBlockBodies eth.GetBlockBodiesPacket66
type GetBlockBodies eth.GetBlockBodiesPacket

func (msg GetBlockBodies) Code() int { return 21 }
func (msg GetBlockBodies) ReqID() uint64 { return msg.RequestId }

// BlockBodies is the network packet for block content distribution.
type BlockBodies eth.BlockBodiesPacket66
type BlockBodies eth.BlockBodiesPacket

func (msg BlockBodies) Code() int { return 22 }
func (msg BlockBodies) ReqID() uint64 { return msg.RequestId }
Expand All @@ -132,7 +132,7 @@ func (msg NewBlock) Code() int { return 23 }
func (msg NewBlock) ReqID() uint64 { return 0 }

// NewPooledTransactionHashes66 is the network packet for the tx hash propagation message.
type NewPooledTransactionHashes66 eth.NewPooledTransactionHashesPacket66
type NewPooledTransactionHashes66 eth.NewPooledTransactionHashesPacket67

func (msg NewPooledTransactionHashes66) Code() int { return 24 }
func (msg NewPooledTransactionHashes66) ReqID() uint64 { return 0 }
Expand All @@ -143,7 +143,7 @@ type NewPooledTransactionHashes eth.NewPooledTransactionHashesPacket68
func (msg NewPooledTransactionHashes) Code() int { return 24 }
func (msg NewPooledTransactionHashes) ReqID() uint64 { return 0 }

type GetPooledTransactions eth.GetPooledTransactionsPacket66
type GetPooledTransactions eth.GetPooledTransactionsPacket

func (msg GetPooledTransactions) Code() int { return 25 }
func (msg GetPooledTransactions) ReqID() uint64 { return msg.RequestId }
Expand Down Expand Up @@ -200,25 +200,25 @@ func (c *Conn) Read() (Message, error) {
case (Status{}).Code():
msg = new(Status)
case (GetBlockHeaders{}).Code():
ethMsg := new(eth.GetBlockHeadersPacket66)
ethMsg := new(eth.GetBlockHeadersPacket)
if err := rlp.DecodeBytes(rawData, ethMsg); err != nil {
return nil, errorf("could not rlp decode message: %v, %x", err, rawData)
}
return (*GetBlockHeaders)(ethMsg), nil
case (BlockHeaders{}).Code():
ethMsg := new(eth.BlockHeadersPacket66)
ethMsg := new(eth.BlockHeadersPacket)
if err := rlp.DecodeBytes(rawData, ethMsg); err != nil {
return nil, errorf("could not rlp decode message: %v, %x", err, rawData)
}
return (*BlockHeaders)(ethMsg), nil
case (GetBlockBodies{}).Code():
ethMsg := new(eth.GetBlockBodiesPacket66)
ethMsg := new(eth.GetBlockBodiesPacket)
if err := rlp.DecodeBytes(rawData, ethMsg); err != nil {
return nil, errorf("could not rlp decode message: %v, %x", err, rawData)
}
return (*GetBlockBodies)(ethMsg), nil
case (BlockBodies{}).Code():
ethMsg := new(eth.BlockBodiesPacket66)
ethMsg := new(eth.BlockBodiesPacket)
if err := rlp.DecodeBytes(rawData, ethMsg); err != nil {
return nil, errorf("could not rlp decode message: %v, %x", err, rawData)
}
Expand All @@ -237,7 +237,7 @@ func (c *Conn) Read() (Message, error) {
}
msg = new(NewPooledTransactionHashes66)
case (GetPooledTransactions{}.Code()):
ethMsg := new(eth.GetPooledTransactionsPacket66)
ethMsg := new(eth.GetPooledTransactionsPacket)
if err := rlp.DecodeBytes(rawData, ethMsg); err != nil {
return nil, errorf("could not rlp decode message: %v, %x", err, rawData)
}
Expand Down Expand Up @@ -422,8 +422,8 @@ func (c *Conn) readAndServe(timeout time.Duration) (Message, error) {
return nil, errorf("could not get headers for inbound header request: %v", err)
}
resp := &BlockHeaders{
RequestId: msg.ReqID(),
BlockHeadersPacket: eth.BlockHeadersPacket(headers),
RequestId: msg.ReqID(),
BlockHeadersRequest: eth.BlockHeadersRequest(headers),
}
if _, err := c.Write(resp); err != nil {
return nil, errorf("could not write to connection: %v", err)
Expand Down Expand Up @@ -455,7 +455,7 @@ func (c *Conn) headersRequest(request *GetBlockHeaders, reqID uint64) ([]*types.
if !ok {
return nil, fmt.Errorf("unexpected message received: %s", pretty.Sdump(msg))
}
headers := []*types.Header(resp.BlockHeadersPacket)
headers := []*types.Header(resp.BlockHeadersRequest)
return headers, nil
}

Expand Down
33 changes: 17 additions & 16 deletions simulators/ethereum/engine/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ module github.com/ethereum/hive/simulators/ethereum/engine
go 1.20

require (
github.com/crate-crypto/go-kzg-4844 v0.3.0
github.com/crate-crypto/go-kzg-4844 v0.6.1-0.20231019121413-3621cc59f0c7
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/go-ethereum v1.13.1
github.com/ethereum/hive v0.0.0-20230919110229-d58aec4a3eb5
github.com/golang-jwt/jwt/v4 v4.4.3
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/holiman/uint256 v1.2.3
github.com/pkg/errors v0.9.1
golang.org/x/exp v0.0.0-20230810033253-352e893a4cad
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
)

require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.0 // indirect
github.com/VictoriaMetrics/fastcache v1.12.1 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.7.0 // indirect
Expand All @@ -25,15 +25,16 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06 // indirect
github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.11.0 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/deepmap/oapi-codegen v1.12.4 // indirect
github.com/ethereum/c-kzg-4844 v0.3.1 // indirect
github.com/ethereum/c-kzg-4844 v0.3.2-0.20231019020040-748283cced54 // indirect
github.com/fjl/memsize v0.0.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
Expand All @@ -42,7 +43,7 @@ require (
github.com/go-stack/stack v1.8.1 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand All @@ -59,7 +60,7 @@ require (
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
Expand All @@ -85,17 +86,17 @@ require (
github.com/urfave/cli/v2 v2.25.7 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.1 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ethereum/go-ethereum => github.com/lightclient/go-ethereum v1.10.10-0.20230926150549-ae44519d720c
replace github.com/ethereum/go-ethereum => github.com/lightclient/go-ethereum v1.10.10-0.20231019143932-4d161dee0c4c
Loading

0 comments on commit bc70996

Please sign in to comment.