generated from flashbots/go-template
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Add support for Electra #613
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
c9f2a02
Begin to add Electra support
jtraglia 9b69d61
Add electra fork versions & fix tests
jtraglia 33b6f64
Add ElectraUnblindSignedBlock
jtraglia 8770896
Use electra fork of go-boost-utils
jtraglia 40aeed5
Use electra fork of geth & add test
jtraglia 5794db2
Add support for deposit receipts
jtraglia 096be7f
Run make fmt
jtraglia 573d448
Update some redis things
jtraglia 770d711
Replace Exits with WithdrawRequests
jtraglia 8a5ed48
Rename WithdrawRequest to WithdrawalRequest
jtraglia 002f5e5
Merge remote-tracking branch 'origin/main' into electra
jtraglia ec5f753
Use go-*-client@electra & lightclient's geth
jtraglia a9caf4e
Fix linter issues
jtraglia b0e3d4d
Fix issues & temporarily skip block simulation
jtraglia e63a669
Use new go-eth2-client
jtraglia 3577f76
Use jtraglia's geth block-validation branch
jtraglia fba3991
update deps
avalonche 7fb201f
Merge remote-tracking branch 'origin/main' into electra
jtraglia 40fe836
Update for v1.5.0-alpha.6
jtraglia acb5536
Remove replacement for geth
jtraglia 6ba1b5d
Try to fix linters
jtraglia 20c3cf5
Remove toolchain from go.mod
jtraglia 0f0fe8c
Maybe fix linter errors
jtraglia 94e0115
Update deps
jtraglia aac580d
Update go-eth2-client for alpha.7 support
jtraglia 1278068
Run go mod tidy
jtraglia 61a5230
Add execution request support
jtraglia 94882aa
Update go-eth2-client
jtraglia 68a6618
Update go-builder-client
jtraglia 20d0a95
Fix lint
jtraglia fe05f94
Temporarly disable block simulation
jtraglia 873bbc4
Add debug log for registration timestamp
jtraglia 67615f0
Revert "Add debug log for registration timestamp"
jtraglia 5491a31
Reapply "Add debug log for registration timestamp"
jtraglia 3d1cf3c
Revert "Temporarly disable block simulation"
jtraglia 940dc33
Remove debug log for registration timestamp
jtraglia 0557d53
Update go-eth2-client to latest electra commit
jtraglia 46c6c69
Update golang version in Dockerfile
jtraglia a6d2ce5
Add Electra case to VersionedSubmitBlockRequest
jtraglia e5d991e
Fix call to flashbots_validateBuilderSubmissionV4 (#671)
ryanschneider 0743dc4
Update go-builder-client & remove replacement
jtraglia 8a6ed9f
Merge branch 'main' into electra
ryanschneider fb6973b
fixup: re-run go mod tidy after resolving conflicts
ryanschneider fd61c64
fixup: use geth 1.14.13
ryanschneider fced1f3
fixup: geth math removed MaxUint64
ryanschneider 8321f63
Add temporary ffIgnoreAllValidationErrors flag
jtraglia 12fbbfc
Add some debug messages
jtraglia 54c9bf8
Add more debug prints
jtraglia a32d82a
Add another debug print
jtraglia 7b592ea
Revert "Add another debug print"
jtraglia 65453e5
Revert "Add more debug prints"
jtraglia 32e2449
Revert "Add some debug messages"
jtraglia 7fd62d4
Revert "Add temporary ffIgnoreAllValidationErrors flag"
jtraglia 38711fd
Reapply "Add temporary ffIgnoreAllValidationErrors flag"
jtraglia e6606f1
Revert "Reapply "Add temporary ffIgnoreAllValidationErrors flag""
jtraglia 0ba3dd0
Pin linter versions
jtraglia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -12,6 +12,7 @@ import ( | |||
"github.com/attestantio/go-eth2-client/spec/bellatrix" | ||||
"github.com/attestantio/go-eth2-client/spec/capella" | ||||
"github.com/attestantio/go-eth2-client/spec/deneb" | ||||
"github.com/attestantio/go-eth2-client/spec/electra" | ||||
"github.com/attestantio/go-eth2-client/spec/phase0" | ||||
ssz "github.com/ferranbt/fastssz" | ||||
boostSsz "github.com/flashbots/go-boost-utils/ssz" | ||||
|
@@ -52,9 +53,15 @@ var ( | |||
DenebForkVersionGoerli = "0x04001020" | ||||
DenebForkVersionMainnet = "0x04000000" | ||||
|
||||
ElectraForkVersionHolesky = "0x06017000" | ||||
ElectraForkVersionSepolia = "0x90000074" | ||||
ElectraForkVersionGoerli = "0x05001020" | ||||
ElectraForkVersionMainnet = "0x05000000" | ||||
|
||||
ForkVersionStringBellatrix = "bellatrix" | ||||
ForkVersionStringCapella = "capella" | ||||
ForkVersionStringDeneb = "deneb" | ||||
ForkVersionStringElectra = "electra" | ||||
) | ||||
|
||||
type EthNetworkDetails struct { | ||||
|
@@ -64,11 +71,13 @@ type EthNetworkDetails struct { | |||
BellatrixForkVersionHex string | ||||
CapellaForkVersionHex string | ||||
DenebForkVersionHex string | ||||
ElectraForkVersionHex string | ||||
|
||||
DomainBuilder phase0.Domain | ||||
DomainBeaconProposerBellatrix phase0.Domain | ||||
DomainBeaconProposerCapella phase0.Domain | ||||
DomainBeaconProposerDeneb phase0.Domain | ||||
DomainBeaconProposerElectra phase0.Domain | ||||
} | ||||
|
||||
func NewEthNetworkDetails(networkName string) (ret *EthNetworkDetails, err error) { | ||||
|
@@ -77,10 +86,12 @@ func NewEthNetworkDetails(networkName string) (ret *EthNetworkDetails, err error | |||
var bellatrixForkVersion string | ||||
var capellaForkVersion string | ||||
var denebForkVersion string | ||||
var electraForkVersion string | ||||
var domainBuilder phase0.Domain | ||||
var domainBeaconProposerBellatrix phase0.Domain | ||||
var domainBeaconProposerCapella phase0.Domain | ||||
var domainBeaconProposerDeneb phase0.Domain | ||||
var domainBeaconProposerElectra phase0.Domain | ||||
|
||||
switch networkName { | ||||
case EthNetworkHolesky: | ||||
|
@@ -89,30 +100,35 @@ func NewEthNetworkDetails(networkName string) (ret *EthNetworkDetails, err error | |||
bellatrixForkVersion = BellatrixForkVersionHolesky | ||||
capellaForkVersion = CapellaForkVersionHolesky | ||||
denebForkVersion = DenebForkVersionHolesky | ||||
electraForkVersion = ElectraForkVersionHolesky | ||||
case EthNetworkSepolia: | ||||
genesisForkVersion = GenesisForkVersionSepolia | ||||
genesisValidatorsRoot = GenesisValidatorsRootSepolia | ||||
bellatrixForkVersion = BellatrixForkVersionSepolia | ||||
capellaForkVersion = CapellaForkVersionSepolia | ||||
denebForkVersion = DenebForkVersionSepolia | ||||
electraForkVersion = ElectraForkVersionSepolia | ||||
case EthNetworkGoerli: | ||||
genesisForkVersion = GenesisForkVersionGoerli | ||||
genesisValidatorsRoot = GenesisValidatorsRootGoerli | ||||
bellatrixForkVersion = BellatrixForkVersionGoerli | ||||
capellaForkVersion = CapellaForkVersionGoerli | ||||
denebForkVersion = DenebForkVersionGoerli | ||||
electraForkVersion = ElectraForkVersionGoerli | ||||
case EthNetworkMainnet: | ||||
genesisForkVersion = GenesisForkVersionMainnet | ||||
genesisValidatorsRoot = GenesisValidatorsRootMainnet | ||||
bellatrixForkVersion = BellatrixForkVersionMainnet | ||||
capellaForkVersion = CapellaForkVersionMainnet | ||||
denebForkVersion = DenebForkVersionMainnet | ||||
electraForkVersion = ElectraForkVersionMainnet | ||||
case EthNetworkCustom: | ||||
genesisForkVersion = os.Getenv("GENESIS_FORK_VERSION") | ||||
genesisValidatorsRoot = os.Getenv("GENESIS_VALIDATORS_ROOT") | ||||
bellatrixForkVersion = os.Getenv("BELLATRIX_FORK_VERSION") | ||||
capellaForkVersion = os.Getenv("CAPELLA_FORK_VERSION") | ||||
denebForkVersion = os.Getenv("DENEB_FORK_VERSION") | ||||
electraForkVersion = os.Getenv("ELECTRA_FORK_VERSION") | ||||
default: | ||||
return nil, fmt.Errorf("%w: %s", ErrUnknownNetwork, networkName) | ||||
} | ||||
|
@@ -137,44 +153,55 @@ func NewEthNetworkDetails(networkName string) (ret *EthNetworkDetails, err error | |||
return nil, err | ||||
} | ||||
|
||||
domainBeaconProposerElectra, err = ComputeDomain(boostSsz.DomainTypeBeaconProposer, electraForkVersion, genesisValidatorsRoot) | ||||
if err != nil { | ||||
return nil, err | ||||
} | ||||
|
||||
return &EthNetworkDetails{ | ||||
Name: networkName, | ||||
GenesisForkVersionHex: genesisForkVersion, | ||||
GenesisValidatorsRootHex: genesisValidatorsRoot, | ||||
BellatrixForkVersionHex: bellatrixForkVersion, | ||||
CapellaForkVersionHex: capellaForkVersion, | ||||
DenebForkVersionHex: denebForkVersion, | ||||
ElectraForkVersionHex: electraForkVersion, | ||||
DomainBuilder: domainBuilder, | ||||
DomainBeaconProposerBellatrix: domainBeaconProposerBellatrix, | ||||
DomainBeaconProposerCapella: domainBeaconProposerCapella, | ||||
DomainBeaconProposerDeneb: domainBeaconProposerDeneb, | ||||
DomainBeaconProposerElectra: domainBeaconProposerElectra, | ||||
}, nil | ||||
} | ||||
|
||||
func (e *EthNetworkDetails) String() string { | ||||
return fmt.Sprintf( | ||||
`EthNetworkDetails{ | ||||
Name: %s, | ||||
GenesisForkVersionHex: %s, | ||||
Name: %s, | ||||
GenesisForkVersionHex: %s, | ||||
GenesisValidatorsRootHex: %s, | ||||
BellatrixForkVersionHex: %s, | ||||
CapellaForkVersionHex: %s, | ||||
BellatrixForkVersionHex: %s, | ||||
CapellaForkVersionHex: %s, | ||||
DenebForkVersionHex: %s, | ||||
DomainBuilder: %x, | ||||
DomainBeaconProposerBellatrix: %x, | ||||
DomainBeaconProposerCapella: %x, | ||||
ElectraForkVersionHex: %s, | ||||
DomainBuilder: %x, | ||||
DomainBeaconProposerBellatrix: %x, | ||||
DomainBeaconProposerCapella: %x, | ||||
DomainBeaconProposerDeneb: %x | ||||
DomainBeaconProposerElectra: %x | ||||
}`, | ||||
e.Name, | ||||
e.GenesisForkVersionHex, | ||||
e.GenesisValidatorsRootHex, | ||||
e.BellatrixForkVersionHex, | ||||
e.CapellaForkVersionHex, | ||||
e.DenebForkVersionHex, | ||||
e.ElectraForkVersionHex, | ||||
e.DomainBuilder, | ||||
e.DomainBeaconProposerBellatrix, | ||||
e.DomainBeaconProposerCapella, | ||||
e.DomainBeaconProposerDeneb) | ||||
e.DomainBeaconProposerDeneb, | ||||
e.DomainBeaconProposerElectra) | ||||
} | ||||
|
||||
type PubkeyHex string | ||||
|
@@ -414,6 +441,9 @@ type BlockSubmissionInfo struct { | |||
Blobs []deneb.Blob | ||||
BlobGasUsed uint64 | ||||
ExcessBlobGas uint64 | ||||
DepositRequests []*electra.DepositRequest | ||||
WithdrawalRequests []*electra.WithdrawalRequest | ||||
ConsolidationRequests []*electra.ConsolidationRequest | ||||
} | ||||
|
||||
/* | ||||
|
@@ -425,6 +455,8 @@ which is sufficient data to set the bid of the builder. The `Transactions` | |||
and `Withdrawals` fields are required to construct the full SignedBeaconBlock | ||||
and are parsed asynchronously. | ||||
|
||||
TODO(JWT): Does this need to be updated? It hasn't been updated for Deneb. | ||||
|
||||
Comment on lines
+458
to
+459
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
Header only layout: | ||||
[000-236) = Message (236 bytes) | ||||
[236-240) = offset1 ( 4 bytes) | ||||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be separate upgrade added deneb support here #618
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea. Thank you for making that PR. I will remove this comment.