Skip to content

Commit 66e1fd3

Browse files
Merge branch 'ethereum:master' into fix/p2p
2 parents 01d512a + 5d51208 commit 66e1fd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1441
-301
lines changed

.github/workflows/validate_pr.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,37 @@ jobs:
88
validate-pr:
99
runs-on: ubuntu-latest
1010
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
1114
- name: Check PR Title Format
1215
uses: actions/github-script@v7
1316
with:
1417
script: |
18+
const fs = require('fs');
19+
const path = require('path');
1520
const prTitle = context.payload.pull_request.title;
1621
const titleRegex = /^([\w\s,{}/.]+): .+/;
1722
1823
if (!titleRegex.test(prTitle)) {
1924
core.setFailed(`PR title "${prTitle}" does not match required format: directory, ...: description`);
2025
return;
2126
}
27+
28+
const match = prTitle.match(titleRegex);
29+
const dirPart = match[1];
30+
const directories = dirPart.split(',').map(d => d.trim());
31+
const missingDirs = [];
32+
for (const dir of directories) {
33+
const fullPath = path.join(process.env.GITHUB_WORKSPACE, dir);
34+
if (!fs.existsSync(fullPath)) {
35+
missingDirs.push(dir);
36+
}
37+
}
38+
39+
if (missingDirs.length > 0) {
40+
core.setFailed(`The following directories in the PR title do not exist: ${missingDirs.join(', ')}`);
41+
return;
42+
}
2243
2344
console.log('✅ PR title format is valid');

accounts/usbwallet/wallet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ func (w *wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID
632632
// data is not supported for Ledger wallets, so this method will always return
633633
// an error.
634634
func (w *wallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error) {
635-
return w.SignText(account, accounts.TextHash(text))
635+
return w.SignText(account, text)
636636
}
637637

638638
// SignTxWithPassphrase implements accounts.Wallet, attempting to sign the given

beacon/blsync/engineclient.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,16 @@ func (ec *engineClient) callNewPayload(fork string, event types.ChainHeadEvent)
101101
params = []any{execData}
102102
)
103103
switch fork {
104-
case "electra":
104+
case "altair", "bellatrix":
105+
method = "engine_newPayloadV1"
106+
case "capella":
107+
method = "engine_newPayloadV2"
108+
case "deneb":
109+
method = "engine_newPayloadV3"
110+
parentBeaconRoot := event.BeaconHead.ParentRoot
111+
blobHashes := collectBlobHashes(event.Block)
112+
params = append(params, blobHashes, parentBeaconRoot)
113+
default: // electra, fulu and above
105114
method = "engine_newPayloadV4"
106115
parentBeaconRoot := event.BeaconHead.ParentRoot
107116
blobHashes := collectBlobHashes(event.Block)
@@ -110,15 +119,6 @@ func (ec *engineClient) callNewPayload(fork string, event types.ChainHeadEvent)
110119
hexRequests[i] = hexutil.Bytes(event.ExecRequests[i])
111120
}
112121
params = append(params, blobHashes, parentBeaconRoot, hexRequests)
113-
case "deneb":
114-
method = "engine_newPayloadV3"
115-
parentBeaconRoot := event.BeaconHead.ParentRoot
116-
blobHashes := collectBlobHashes(event.Block)
117-
params = append(params, blobHashes, parentBeaconRoot)
118-
case "capella":
119-
method = "engine_newPayloadV2"
120-
default:
121-
method = "engine_newPayloadV1"
122122
}
123123

124124
ctx, cancel := context.WithTimeout(ec.rootCtx, time.Second*5)
@@ -145,12 +145,12 @@ func (ec *engineClient) callForkchoiceUpdated(fork string, event types.ChainHead
145145

146146
var method string
147147
switch fork {
148-
case "deneb", "electra":
149-
method = "engine_forkchoiceUpdatedV3"
148+
case "altair", "bellatrix":
149+
method = "engine_forkchoiceUpdatedV1"
150150
case "capella":
151151
method = "engine_forkchoiceUpdatedV2"
152-
default:
153-
method = "engine_forkchoiceUpdatedV1"
152+
default: // deneb, electra, fulu and above
153+
method = "engine_forkchoiceUpdatedV3"
154154
}
155155

156156
ctx, cancel := context.WithTimeout(ec.rootCtx, time.Second*5)

beacon/light/canonical.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ func newCanonicalStore[T any](db ethdb.Iteratee, keyPrefix []byte) (*canonicalSt
6969

7070
// databaseKey returns the database key belonging to the given period.
7171
func (cs *canonicalStore[T]) databaseKey(period uint64) []byte {
72-
return binary.BigEndian.AppendUint64(append([]byte{}, cs.keyPrefix...), period)
72+
key := make([]byte, len(cs.keyPrefix)+8)
73+
copy(key, cs.keyPrefix)
74+
binary.BigEndian.PutUint64(key[len(cs.keyPrefix):], period)
75+
return key
7376
}
7477

7578
// add adds the given item to the database. It also ensures that the range remains

beacon/params/checkpoint_hoodi.hex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0x1bbf958008172591b6cbdb3d8d52e26998258e83d4bdb9eec10969d84519a6bd
1+
0xbb7a7f3c40d8ea0b450f91587db65d0f1c079669277e01a0426c8911702a863a
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0x2fe39a39b6f7cbd549e0f74d259de6db486005a65bd3bd92840dd6ce21d6f4c8
1+
0x2af778d703186526a1b6304b423f338f11556206f618643c3f7fa0d7b1ef5c9b
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0x86686b2b366e24134e0e3969a9c5f3759f92e5d2b04785b42e22cc7d468c2107
1+
0x48a89c9ea7ba19de2931797974cf8722344ab231c0edada278b108ef74125478

beacon/params/config.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import (
3838
// across signing different data structures.
3939
const syncCommitteeDomain = 7
4040

41-
var knownForks = []string{"GENESIS", "ALTAIR", "BELLATRIX", "CAPELLA", "DENEB"}
41+
var knownForks = []string{"GENESIS", "ALTAIR", "BELLATRIX", "CAPELLA", "DENEB", "ELECTRA", "FULU"}
4242

4343
// ClientConfig contains beacon light client configuration.
4444
type ClientConfig struct {
@@ -103,6 +103,9 @@ func (c *ChainConfig) LoadForks(file []byte) error {
103103
epochs["GENESIS"] = 0
104104

105105
for key, value := range config {
106+
if value == nil {
107+
continue
108+
}
106109
if strings.HasSuffix(key, "_FORK_VERSION") {
107110
name := key[:len(key)-len("_FORK_VERSION")]
108111
switch version := value.(type) {

beacon/params/config_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ ALTAIR_FORK_EPOCH: 1
1515
EIP7928_FORK_VERSION: 0xb0000038
1616
EIP7928_FORK_EPOCH: 18446744073709551615
1717
18+
EIP7XXX_FORK_VERSION:
19+
EIP7XXX_FORK_EPOCH:
20+
1821
BLOB_SCHEDULE: []
1922
`
2023
c := &ChainConfig{}

beacon/params/networks.go

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,39 @@ var (
4040
GenesisTime: 1606824023,
4141
Checkpoint: common.HexToHash(checkpointMainnet),
4242
}).
43-
AddFork("GENESIS", 0, []byte{0, 0, 0, 0}).
44-
AddFork("ALTAIR", 74240, []byte{1, 0, 0, 0}).
45-
AddFork("BELLATRIX", 144896, []byte{2, 0, 0, 0}).
46-
AddFork("CAPELLA", 194048, []byte{3, 0, 0, 0}).
47-
AddFork("DENEB", 269568, []byte{4, 0, 0, 0}).
48-
AddFork("ELECTRA", 364032, []byte{5, 0, 0, 0})
43+
AddFork("GENESIS", 0, common.FromHex("0x00000000")).
44+
AddFork("ALTAIR", 74240, common.FromHex("0x01000000")).
45+
AddFork("BELLATRIX", 144896, common.FromHex("0x02000000")).
46+
AddFork("CAPELLA", 194048, common.FromHex("0x03000000")).
47+
AddFork("DENEB", 269568, common.FromHex("0x04000000")).
48+
AddFork("ELECTRA", 364032, common.FromHex("0x05000000")).
49+
AddFork("FULU", 411392, common.FromHex("0x06000000"))
4950

5051
SepoliaLightConfig = (&ChainConfig{
5152
GenesisValidatorsRoot: common.HexToHash("0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078"),
5253
GenesisTime: 1655733600,
5354
Checkpoint: common.HexToHash(checkpointSepolia),
5455
}).
55-
AddFork("GENESIS", 0, []byte{144, 0, 0, 105}).
56-
AddFork("ALTAIR", 50, []byte{144, 0, 0, 112}).
57-
AddFork("BELLATRIX", 100, []byte{144, 0, 0, 113}).
58-
AddFork("CAPELLA", 56832, []byte{144, 0, 0, 114}).
59-
AddFork("DENEB", 132608, []byte{144, 0, 0, 115}).
60-
AddFork("ELECTRA", 222464, []byte{144, 0, 0, 116})
56+
AddFork("GENESIS", 0, common.FromHex("0x90000069")).
57+
AddFork("ALTAIR", 50, common.FromHex("0x90000070")).
58+
AddFork("BELLATRIX", 100, common.FromHex("0x90000071")).
59+
AddFork("CAPELLA", 56832, common.FromHex("0x90000072")).
60+
AddFork("DENEB", 132608, common.FromHex("0x90000073")).
61+
AddFork("ELECTRA", 222464, common.FromHex("0x90000074")).
62+
AddFork("FULU", 272640, common.FromHex("0x90000075"))
6163

6264
HoleskyLightConfig = (&ChainConfig{
6365
GenesisValidatorsRoot: common.HexToHash("0x9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1"),
6466
GenesisTime: 1695902400,
6567
Checkpoint: common.HexToHash(checkpointHolesky),
6668
}).
67-
AddFork("GENESIS", 0, []byte{1, 1, 112, 0}).
68-
AddFork("ALTAIR", 0, []byte{2, 1, 112, 0}).
69-
AddFork("BELLATRIX", 0, []byte{3, 1, 112, 0}).
70-
AddFork("CAPELLA", 256, []byte{4, 1, 112, 0}).
71-
AddFork("DENEB", 29696, []byte{5, 1, 112, 0}).
72-
AddFork("ELECTRA", 115968, []byte{6, 1, 112, 0})
69+
AddFork("GENESIS", 0, common.FromHex("0x01017000")).
70+
AddFork("ALTAIR", 0, common.FromHex("0x02017000")).
71+
AddFork("BELLATRIX", 0, common.FromHex("0x03017000")).
72+
AddFork("CAPELLA", 256, common.FromHex("0x04017000")).
73+
AddFork("DENEB", 29696, common.FromHex("0x05017000")).
74+
AddFork("ELECTRA", 115968, common.FromHex("0x06017000")).
75+
AddFork("FULU", 165120, common.FromHex("0x07017000"))
7376

7477
HoodiLightConfig = (&ChainConfig{
7578
GenesisValidatorsRoot: common.HexToHash("0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f"),
@@ -82,5 +85,5 @@ var (
8285
AddFork("CAPELLA", 0, common.FromHex("0x40000910")).
8386
AddFork("DENEB", 0, common.FromHex("0x50000910")).
8487
AddFork("ELECTRA", 2048, common.FromHex("0x60000910")).
85-
AddFork("FULU", 18446744073709551615, common.FromHex("0x70000910"))
88+
AddFork("FULU", 50688, common.FromHex("0x70000910"))
8689
)

0 commit comments

Comments
 (0)