Skip to content

Commit 35c2950

Browse files
Merge branch 'master' into patch-4
2 parents f4d3df6 + 7805e20 commit 35c2950

File tree

5 files changed

+41
-5
lines changed

5 files changed

+41
-5
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
@@ -635,7 +635,7 @@ func (w *wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID
635635
// data is not supported for Ledger wallets, so this method will always return
636636
// an error.
637637
func (w *wallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error) {
638-
return w.SignText(account, accounts.TextHash(text))
638+
return w.SignText(account, text)
639639
}
640640

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

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) {

core/vm/memory.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func (m *Memory) Free() {
4444
// To reduce peak allocation, return only smaller memory instances to the pool.
4545
const maxBufferSize = 16 << 10
4646
if cap(m.store) <= maxBufferSize {
47+
clear(m.store)
4748
m.store = m.store[:0]
4849
m.lastGasCost = 0
4950
memoryPool.Put(m)
@@ -76,10 +77,14 @@ func (m *Memory) Set32(offset uint64, val *uint256.Int) {
7677
val.PutUint256(m.store[offset:])
7778
}
7879

79-
// Resize resizes the memory to size
80+
// Resize grows the memory to the requested size.
8081
func (m *Memory) Resize(size uint64) {
81-
if uint64(m.Len()) < size {
82-
m.store = append(m.store, make([]byte, size-uint64(m.Len()))...)
82+
if uint64(len(m.store)) < size {
83+
if uint64(cap(m.store)) >= size {
84+
m.store = m.store[:size]
85+
} else {
86+
m.store = append(m.store, make([]byte, size-uint64(len(m.store)))...)
87+
}
8388
}
8489
}
8590

core/vm/memory_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,10 @@ func TestMemoryCopy(t *testing.T) {
8383
}
8484
}
8585
}
86+
87+
func BenchmarkResize(b *testing.B) {
88+
memory := NewMemory()
89+
for i := range b.N {
90+
memory.Resize(uint64(i))
91+
}
92+
}

0 commit comments

Comments
 (0)