Skip to content

Commit

Permalink
Adjust logsBloom encoding (ethereum#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruteri authored and avalonche committed Feb 6, 2023
1 parent 017662f commit 3f303fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions builder/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,13 @@ func executableDataToExecutionPayload(data *beacon.ExecutableDataV1) *boostTypes
for i, tx := range data.Transactions {
transactionData[i] = hexutil.Bytes(tx)
}
logsBloom := boostTypes.Bloom{}
logsBloom.FromSlice(data.LogsBloom)

return &boostTypes.ExecutionPayload{
ParentHash: [32]byte(data.ParentHash),
FeeRecipient: [20]byte(data.FeeRecipient),
StateRoot: [32]byte(data.StateRoot),
ReceiptsRoot: [32]byte(data.ReceiptsRoot),
LogsBloom: logsBloom,
LogsBloom: boostTypes.Bloom(types.BytesToBloom(data.LogsBloom)),
Random: [32]byte(data.Random),
BlockNumber: data.Number,
GasLimit: data.GasLimit,
Expand Down
1 change: 1 addition & 0 deletions builder/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func TestGetHeader(t *testing.T) {
BlockHash: common.HexToHash("0xbfbfbfb"),
BaseFeePerGas: big.NewInt(12),
ExtraData: []byte{},
LogsBloom: []byte{0x00, 0x05, 0x10},
}
forkchoiceBlock := &types.Block{
Profit: big.NewInt(10),
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,8 @@ github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c h1:CndMRAH4JIwxbW8KYq
github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/flashbots/go-boost-utils v0.1.2 h1:xcwO6rhLmdbZ+ttN8PjHQynqY1pm+RCA56eGP9wPp10=
github.com/flashbots/go-boost-utils v0.1.2/go.mod h1:v4f01OjPm5jFjzVhcJEKHLFZzX/yTeme9284Tbuah8s=
github.com/flashbots/go-boost-utils v0.1.3-0.20220601173756-01db408b8c89 h1:3wVzFGJbXm8BjuFav3ZPKFAz01IY6JDjV38b3Ccuk2I=
github.com/flashbots/go-boost-utils v0.1.3-0.20220601173756-01db408b8c89/go.mod h1:v4f01OjPm5jFjzVhcJEKHLFZzX/yTeme9284Tbuah8s=
github.com/flashbots/go-boost-utils v0.1.3-0.20220601182529-417a64679a5d h1:hoqkcRKMupXCWW38fDfvNcuIxl9eCAZrguw3dNCw+Qg=
github.com/flashbots/go-boost-utils v0.1.3-0.20220601182529-417a64679a5d/go.mod h1:v4f01OjPm5jFjzVhcJEKHLFZzX/yTeme9284Tbuah8s=
github.com/flashbots/go-utils v0.4.4 h1:J0LUifVEpVYE+ZbK/DeGay4E3B6+Yh8pKLgfv5A0Oq0=
github.com/flashbots/go-utils v0.4.4/go.mod h1:weSbiNnH+xsmK8t3TDDJxluv4+qnwRWmKay2QQa8Yfc=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
Expand Down

0 comments on commit 3f303fe

Please sign in to comment.