Skip to content

Commit ce4530a

Browse files
committed
Merge branch 'master' into simulate/fix-revert-err-code
2 parents 8e33cde + 7b7be24 commit ce4530a

File tree

360 files changed

+20337
-7654
lines changed

Some content is hidden

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

360 files changed

+20337
-7654
lines changed

.gitea/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,27 @@ jobs:
122122
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
123123
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
124124

125+
keeper:
126+
name: Keeper Build
127+
runs-on: ubuntu-latest
128+
steps:
129+
- uses: actions/checkout@v4
130+
131+
- name: Set up Go
132+
uses: actions/setup-go@v5
133+
with:
134+
go-version: 1.24
135+
cache: false
136+
137+
- name: Install cross toolchain
138+
run: |
139+
apt-get update
140+
apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib
141+
142+
- name: Build (amd64)
143+
run: |
144+
go run build/ci.go keeper -dlgo
145+
125146
windows:
126147
name: Windows Build
127148
runs-on: "win-11"

.github/workflows/go.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,47 @@ jobs:
3434
go run build/ci.go check_generate
3535
go run build/ci.go check_baddeps
3636
37+
keeper:
38+
name: Keeper Builds
39+
needs: test
40+
runs-on: [self-hosted-ghr, size-l-x64]
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
submodules: true
45+
46+
- name: Set up Go
47+
uses: actions/setup-go@v5
48+
with:
49+
go-version: '1.25'
50+
cache: false
51+
52+
- name: Build
53+
run: go run build/ci.go keeper
54+
55+
test-32bit:
56+
name: "32bit tests"
57+
needs: test
58+
runs-on: [self-hosted-ghr, size-l-x64]
59+
steps:
60+
- uses: actions/checkout@v4
61+
with:
62+
submodules: false
63+
64+
- name: Set up Go
65+
uses: actions/setup-go@v5
66+
with:
67+
go-version: '1.25'
68+
cache: false
69+
70+
- name: Install cross toolchain
71+
run: |
72+
apt-get update
73+
apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib
74+
75+
- name: Build
76+
run: go run build/ci.go test -arch 386 -short -p 8
77+
3778
test:
3879
name: Test
3980
needs: lint

.github/workflows/validate_pr.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,76 @@ jobs:
88
validate-pr:
99
runs-on: ubuntu-latest
1010
steps:
11+
- name: Check for Spam PR
12+
uses: actions/github-script@v7
13+
with:
14+
script: |
15+
const prTitle = context.payload.pull_request.title;
16+
const spamRegex = /^(feat|chore|fix)(\(.*\))?\s*:/i;
17+
18+
if (spamRegex.test(prTitle)) {
19+
// Leave a comment explaining why
20+
await github.rest.issues.createComment({
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
issue_number: context.payload.pull_request.number,
24+
body: `## PR Closed as Spam
25+
26+
This PR was automatically closed because the title format \`feat:\`, \`fix:\`, or \`chore:\` is commonly associated with spam contributions.
27+
28+
If this is a legitimate contribution, please:
29+
1. Review our contribution guidelines
30+
2. Use the correct PR title format: \`directory, ...: description\`
31+
3. Open a new PR with the proper title format
32+
33+
Thank you for your understanding.`
34+
});
35+
36+
// Close the PR
37+
await github.rest.pulls.update({
38+
owner: context.repo.owner,
39+
repo: context.repo.repo,
40+
pull_number: context.payload.pull_request.number,
41+
state: 'closed'
42+
});
43+
44+
core.setFailed('PR closed as spam due to suspicious title format');
45+
return;
46+
}
47+
48+
console.log('✅ PR passed spam check');
49+
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
1153
- name: Check PR Title Format
1254
uses: actions/github-script@v7
1355
with:
1456
script: |
57+
const fs = require('fs');
58+
const path = require('path');
1559
const prTitle = context.payload.pull_request.title;
1660
const titleRegex = /^([\w\s,{}/.]+): .+/;
1761
1862
if (!titleRegex.test(prTitle)) {
1963
core.setFailed(`PR title "${prTitle}" does not match required format: directory, ...: description`);
2064
return;
2165
}
66+
67+
const match = prTitle.match(titleRegex);
68+
const dirPart = match[1];
69+
const directories = dirPart.split(',').map(d => d.trim());
70+
const missingDirs = [];
71+
for (const dir of directories) {
72+
const fullPath = path.join(process.env.GITHUB_WORKSPACE, dir);
73+
if (!fs.existsSync(fullPath)) {
74+
missingDirs.push(dir);
75+
}
76+
}
77+
78+
if (missingDirs.length > 0) {
79+
core.setFailed(`The following directories in the PR title do not exist: ${missingDirs.join(', ')}`);
80+
return;
81+
}
2282
2383
console.log('✅ PR title format is valid');

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@ cmd/ethkey/ethkey
5555
cmd/evm/evm
5656
cmd/geth/geth
5757
cmd/rlpdump/rlpdump
58-
cmd/workload/workload
58+
cmd/workload/workload
59+
cmd/keeper/keeper

SECURITY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Audit reports are published in the `docs` folder: https://github.com/ethereum/go
2121

2222
To find out how to disclose a vulnerability in Ethereum visit [https://bounty.ethereum.org](https://bounty.ethereum.org) or email bounty@ethereum.org. Please read the [disclosure page](https://github.com/ethereum/go-ethereum/security/advisories?state=published) for more information about publicly disclosed security vulnerabilities.
2323

24-
Use the built-in `geth version-check` feature to check whether the software is affected by any known vulnerability. This command will fetch the latest [`vulnerabilities.json`](https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities.json) file which contains known security vulnerabilities concerning `geth`, and cross-check the data against its own version number.
2524

2625
The following key may be used to communicate sensitive information to developers.
2726

accounts/abi/bind/v2/dep_tree_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ func testLinkCase(tcInput linkTestCaseInput) error {
158158
overrideAddrs = make(map[rune]common.Address)
159159
)
160160
// generate deterministic addresses for the override set.
161-
rand.Seed(42)
161+
rng := rand.New(rand.NewSource(42))
162162
for contract := range tcInput.overrides {
163163
var addr common.Address
164-
rand.Read(addr[:])
164+
rng.Read(addr[:])
165165
overrideAddrs[contract] = addr
166166
overridesAddrs[addr] = struct{}{}
167167
}

accounts/abi/bind/v2/util_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,9 @@ func TestWaitDeployedCornerCases(t *testing.T) {
144144
done := make(chan struct{})
145145
go func() {
146146
defer close(done)
147-
want := errors.New("context canceled")
148147
_, err := bind.WaitDeployed(ctx, backend.Client(), tx.Hash())
149-
if err == nil || errors.Is(want, err) {
150-
t.Errorf("error mismatch: want %v, got %v", want, err)
148+
if !errors.Is(err, context.Canceled) {
149+
t.Errorf("error mismatch: want %v, got %v", context.Canceled, err)
151150
}
152151
}()
153152

accounts/accounts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
"github.com/ethereum/go-ethereum"
2525
"github.com/ethereum/go-ethereum/common"
2626
"github.com/ethereum/go-ethereum/core/types"
27+
"github.com/ethereum/go-ethereum/crypto/keccak"
2728
"github.com/ethereum/go-ethereum/event"
28-
"golang.org/x/crypto/sha3"
2929
)
3030

3131
// Account represents an Ethereum account located at a specific location defined
@@ -196,7 +196,7 @@ func TextHash(data []byte) []byte {
196196
// This gives context to the signed message and prevents signing of transactions.
197197
func TextAndHash(data []byte) ([]byte, string) {
198198
msg := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), data)
199-
hasher := sha3.NewLegacyKeccak256()
199+
hasher := keccak.NewLegacyKeccak256()
200200
hasher.Write([]byte(msg))
201201
return hasher.Sum(nil), msg
202202
}

accounts/keystore/keystore.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ func (ks *KeyStore) Export(a accounts.Account, passphrase, newPassphrase string)
418418
if err != nil {
419419
return nil, err
420420
}
421+
defer zeroKey(key.PrivateKey)
421422
var N, P int
422423
if store, ok := ks.storage.(*keyStorePassphrase); ok {
423424
N, P = store.scryptN, store.scryptP
@@ -477,6 +478,7 @@ func (ks *KeyStore) Update(a accounts.Account, passphrase, newPassphrase string)
477478
if err != nil {
478479
return err
479480
}
481+
defer zeroKey(key.PrivateKey)
480482
return ks.storage.StoreKey(a.URL.Path, key, newPassphrase)
481483
}
482484

accounts/keystore/presale.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ func decryptPreSaleKey(fileContent []byte, password string) (key *Key, err error
8181
*/
8282
passBytes := []byte(password)
8383
derivedKey := pbkdf2.Key(passBytes, passBytes, 2000, 16, sha256.New)
84+
if len(cipherText)%aes.BlockSize != 0 {
85+
return nil, errors.New("ciphertext must be a multiple of block size")
86+
}
8487
plainText, err := aesCBCDecrypt(derivedKey, cipherText, iv)
8588
if err != nil {
8689
return nil, err

0 commit comments

Comments
 (0)