mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Merge branch 'master' into patch-4
This commit is contained in:
commit
35c2950d33
5 changed files with 41 additions and 5 deletions
21
.github/workflows/validate_pr.yml
vendored
21
.github/workflows/validate_pr.yml
vendored
|
|
@ -8,10 +8,15 @@ jobs:
|
|||
validate-pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check PR Title Format
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const prTitle = context.payload.pull_request.title;
|
||||
const titleRegex = /^([\w\s,{}/.]+): .+/;
|
||||
|
||||
|
|
@ -19,5 +24,21 @@ jobs:
|
|||
core.setFailed(`PR title "${prTitle}" does not match required format: directory, ...: description`);
|
||||
return;
|
||||
}
|
||||
|
||||
const match = prTitle.match(titleRegex);
|
||||
const dirPart = match[1];
|
||||
const directories = dirPart.split(',').map(d => d.trim());
|
||||
const missingDirs = [];
|
||||
for (const dir of directories) {
|
||||
const fullPath = path.join(process.env.GITHUB_WORKSPACE, dir);
|
||||
if (!fs.existsSync(fullPath)) {
|
||||
missingDirs.push(dir);
|
||||
}
|
||||
}
|
||||
|
||||
if (missingDirs.length > 0) {
|
||||
core.setFailed(`The following directories in the PR title do not exist: ${missingDirs.join(', ')}`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('✅ PR title format is valid');
|
||||
|
|
|
|||
|
|
@ -635,7 +635,7 @@ func (w *wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID
|
|||
// data is not supported for Ledger wallets, so this method will always return
|
||||
// an error.
|
||||
func (w *wallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error) {
|
||||
return w.SignText(account, accounts.TextHash(text))
|
||||
return w.SignText(account, text)
|
||||
}
|
||||
|
||||
// SignTxWithPassphrase implements accounts.Wallet, attempting to sign the given
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import (
|
|||
// across signing different data structures.
|
||||
const syncCommitteeDomain = 7
|
||||
|
||||
var knownForks = []string{"GENESIS", "ALTAIR", "BELLATRIX", "CAPELLA", "DENEB"}
|
||||
var knownForks = []string{"GENESIS", "ALTAIR", "BELLATRIX", "CAPELLA", "DENEB", "ELECTRA", "FULU"}
|
||||
|
||||
// ClientConfig contains beacon light client configuration.
|
||||
type ClientConfig struct {
|
||||
|
|
@ -103,6 +103,9 @@ func (c *ChainConfig) LoadForks(file []byte) error {
|
|||
epochs["GENESIS"] = 0
|
||||
|
||||
for key, value := range config {
|
||||
if value == nil {
|
||||
continue
|
||||
}
|
||||
if strings.HasSuffix(key, "_FORK_VERSION") {
|
||||
name := key[:len(key)-len("_FORK_VERSION")]
|
||||
switch version := value.(type) {
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ func (m *Memory) Free() {
|
|||
// To reduce peak allocation, return only smaller memory instances to the pool.
|
||||
const maxBufferSize = 16 << 10
|
||||
if cap(m.store) <= maxBufferSize {
|
||||
clear(m.store)
|
||||
m.store = m.store[:0]
|
||||
m.lastGasCost = 0
|
||||
memoryPool.Put(m)
|
||||
|
|
@ -76,10 +77,14 @@ func (m *Memory) Set32(offset uint64, val *uint256.Int) {
|
|||
val.PutUint256(m.store[offset:])
|
||||
}
|
||||
|
||||
// Resize resizes the memory to size
|
||||
// Resize grows the memory to the requested size.
|
||||
func (m *Memory) Resize(size uint64) {
|
||||
if uint64(m.Len()) < size {
|
||||
m.store = append(m.store, make([]byte, size-uint64(m.Len()))...)
|
||||
if uint64(len(m.store)) < size {
|
||||
if uint64(cap(m.store)) >= size {
|
||||
m.store = m.store[:size]
|
||||
} else {
|
||||
m.store = append(m.store, make([]byte, size-uint64(len(m.store)))...)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,3 +83,10 @@ func TestMemoryCopy(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkResize(b *testing.B) {
|
||||
memory := NewMemory()
|
||||
for i := range b.N {
|
||||
memory.Resize(uint64(i))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue