Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
4ab4e4f
params: begin v1.11.7 release cycle
holiman Apr 20, 2023
bbc565a
core/types, params: add blob transaction type, RLP encoded for now (#…
karalabe Apr 21, 2023
d3ece3a
cmd/utils, node: switch to Pebble as the default db if none exists (#…
karalabe Apr 21, 2023
1e556d2
all: remove notion of trusted checkpoints in the post-merge world (#2…
karalabe Apr 24, 2023
bbcb5ea
core, trie: rework trie database (#26813)
rjl493456442 Apr 24, 2023
f541cad
eth: use new atomic types (#27137)
s7v7nislands Apr 25, 2023
f8f9534
p2p/discover: add traffic metrics (#27008)
Exca-DK Apr 25, 2023
9a12cc9
cmd/geth: remove DAO fork test (#27161)
holiman Apr 25, 2023
2f98dd3
graphql: encode Long values as hex (#26894)
s1na Apr 25, 2023
b1113aa
eth: fix crash on querying finalized block (#27162)
s1na Apr 25, 2023
5d3f580
trie: add node type common package (#27160)
rjl493456442 Apr 26, 2023
f8aa623
core/types: fix discrepancy in receipt.EffectiveGasPrice json encodin…
roberto-bayardo Apr 26, 2023
25f9977
les: use atomic type (#27168)
stephenfire Apr 26, 2023
306d177
light: use atomic type (#27169)
stephenfire Apr 26, 2023
66c0c4e
cmd, eth, les: replace Shanghai override flag with Cancun (#27171)
karalabe Apr 26, 2023
8f37322
cmd/geth: make account commands not require datadir lock (#27084)
jsvisa Apr 27, 2023
47cdea5
p2p/discover: concurrent TALKREQ handling (#27112)
fjl Apr 28, 2023
c387186
eth/ethconfig: go fmt (#27194)
ucwong Apr 28, 2023
a865e28
p2p/discover : typo (#27193)
ucwong Apr 28, 2023
52c246f
eth/gasprice: fix typo (#27202)
chirag-bgh May 2, 2023
ae66009
internal/ethapi: add block overrides to eth_call (#26414)
s1na May 2, 2023
a9d7cda
core/types: go generate (#27196)
ucwong May 2, 2023
7d1ebe5
p2p/discover: fix lint nit (#27206)
holiman May 2, 2023
7f6c045
core: remove unused ContractCode method from BlockChain (#27186)
gballet May 2, 2023
29c33d9
graphql, internal: fix typos in comments (#27184)
dzhalaevd May 2, 2023
ac3418d
accounts/abi: resolve name conflict for methods starting with a numbe…
MariusVanDerWijden May 2, 2023
dde2da0
all: remove ethash pow, only retain shims needed for consensus and te…
karalabe May 3, 2023
ffda2c6
rpc: use atomic types (#27214)
s7v7nislands May 4, 2023
79a57d4
eth/downloader: fix error aggregator (#27217)
rjl493456442 May 5, 2023
ba09403
core/txpool : fix map size avoid resizing (#27221)
ucwong May 5, 2023
604e215
eth/tracers: add `txHash` field on txTraceResult (#27183)
sjlee1125 May 5, 2023
cc8d40c
core/state: initialize maps with known size (#27222)
ucwong May 8, 2023
7ac08ba
cmd/geth: rename variable 'extapi' (#27223)
joohhnnn May 8, 2023
81d328a
log: report error when ctx key is non-string (#27226)
ucwong May 8, 2023
5021d36
all: port boring changes from pbss (#27176)
rjl493456442 May 9, 2023
c798507
miner: initialize maps with capacity (#27228)
ucwong May 9, 2023
c62da24
cmd/utils: report the blocknumber when block import fails (#27213)
gballet May 9, 2023
0fb1be0
event: initialize maps with known size (#27233)
ucwong May 9, 2023
a742943
node: fix typos in comments (#27236)
dbadoy May 10, 2023
ae7db28
p2p: initialize maps with known size (#27229)
ucwong May 10, 2023
2169fa3
crypto/kzg4844: pull in the C and Go libs for KZG cryptography (#27155)
karalabe May 10, 2023
c8b0afb
ethclient: acquire the rpc.Client (#27246)
jsvisa May 11, 2023
d17ec0e
ethdb/memorydb: init map with known size (#27241)
ucwong May 11, 2023
7577b9c
core/state: unexport NodeIterator (#27239)
gballet May 11, 2023
a143018
all: new empty trie with types.EmptyRootHash instead of null (#27230)
rjl493456442 May 11, 2023
a340721
metrics: use sync.map in registry (#27159)
Exca-DK May 11, 2023
0b66d47
internal/ethapi: make EstimateGas use `latest` block by default (#24363)
zhiqiangxu May 11, 2023
dffd804
internal/ethapi: remove unused err-return (#27240)
makcandrov May 11, 2023
1982437
core/types: un-ssz blob txs, add json marshalling and tweaks (#27256)
karalabe May 12, 2023
9ca84e6
crypto/kzg4844: upgrade c-kzg-4844 to v0.2.0 (#27257)
jtraglia May 12, 2023
7369752
rpc: websocket should respect the "HTTP_PROXY" by default (#27264)
oseau May 15, 2023
c2148c6
core/asm: remove unused return value (#27272)
joohhnnn May 16, 2023
6e3aa86
internal/ethapi: minor refactor in block serialization (#27268)
jsvisa May 16, 2023
d46f69d
tests/fuzzers/bn256: add PairingCheck fuzzer (#27252)
MariusVanDerWijden May 16, 2023
eb83e7c
core/state/snapshot: check difflayer staleness early (#27255)
holiman May 16, 2023
2f2959d
core/state/pruner: remove unused error-return (#27273)
joohhnnn May 17, 2023
ae1d90e
internal/ethapi: make NewAccount return EIP-55 format (#26973)
alexmylonas May 17, 2023
84c3799
rpc: more accurate checking of handler method signatures (#27287)
stephenfire May 17, 2023
41fafa4
go.mod: upgrade gencodec (#27288)
fjl May 17, 2023
c08dc59
beacon/types: add beacon chain data types (#27292)
zsfelfoldi May 17, 2023
6a6318b
go.mod: use`gopkg.in/yaml.v3` instead of `github.com/go-yaml/yaml` (#…
islishude May 17, 2023
85a4b82
all: tie timestamp based forks to the passage of London (#27279)
karalabe May 19, 2023
99394ad
ethdb/pebble: prevent shutdown-panic (#27238)
holiman May 19, 2023
3223950
cmd/utils: do not check free disk space in dev mode (#27281)
islishude May 19, 2023
944e1a0
beacon/types: auto-generate SyncCommittee marshaling methods (#27296)
fjl May 19, 2023
6fe0252
rpc, internal/cmdtest: increase timeout in tests (#27083)
jsvisa May 22, 2023
b46d37e
graphql: upgrade UI to v2 (#27294)
s1na May 22, 2023
5b792e0
accounts/abi: add ErrorById (#27277)
chawin-a May 22, 2023
a190da9
eth/tracers: fix flatCallTracer crasher (#27304)
minh-bq May 23, 2023
bfded65
core/state: do not ignore null addr while iterative dump (#27320)
pcw109550 May 23, 2023
1a18283
cmd/evm: make batched state-test execution possible (#27318)
holiman May 23, 2023
9231770
rpc: change BlockNumber constant values to match ethclient (#27219)
holiman May 23, 2023
e9c3183
cmd: use errrors.New instead of empty fmt.Errorf (#27329)
jsvisa May 24, 2023
b0095ee
ethclient,event: replace noarg fmt.Errorf with errors.New (#27334)
jsvisa May 24, 2023
21c87e0
crypto: replace noarg fmt.Errorf with errors.New (#27333)
jsvisa May 24, 2023
dd25a4f
les, signer, light: replace noarg fmt.Errorf with errors.New (#27336)
jsvisa May 25, 2023
b21ba66
internal,tests: replace noarg fmt.Errorf with errors.New (#27335)
jsvisa May 25, 2023
8a78a4f
eth,consensus: replace noarg fmt.Errorf with errors.New (#27330)
jsvisa May 25, 2023
33fdd03
ethdb/pebble: fix NewBatchWithSize to set db (#27350)
holiman May 25, 2023
e501b3b
params: go-ethereum v1.12.0 stable
holiman May 25, 2023
8e4e573
Merge commit 'e501b3b05db8e169f67dc78b7b59bc352b3c638d' into merge/fo…
ziogaschr Jun 2, 2023
a6d9e99
cmd/devp2p/internal/ethtest/testdata,cmd/evm/internal/t8ntool,cmd/evm…
ziogaschr Jun 8, 2023
e9a96bd
eth/downloader,les,light: Revert "all: remove notion of trusted check…
ziogaschr Jun 8, 2023
0fc9013
params: remove TrustedCheckpoint and CheckpointOracle for ETH networks
ziogaschr Jun 8, 2023
84b4107
go.mod,go.sum: go mod tidy
ziogaschr Jun 8, 2023
672c36b
core/types: core/types: receipt EffectiveGasPrice to big.Int
ziogaschr Jun 6, 2023
2d42676
core/types: core/types: fix config API use
ziogaschr Jun 6, 2023
b0b1186
core/types: core/types: read BlobTxDataGasPerBlob from vars
ziogaschr Jun 6, 2023
65e992c
consensus/ethash: remove duplicated ethash.verifySeal
ziogaschr Jun 8, 2023
33c80dc
core: core: remove/resolve GenesisAlloc.flush
ziogaschr Jun 6, 2023
8f0eaa3
eth: eth: restore eth handleer checkpoint fields
ziogaschr Jun 7, 2023
b7a785c
cmd/geth,cmd/utils,eth,les: cmd/geth,cmd/utils,eth,les: s/OverrideCan…
ziogaschr Jun 7, 2023
21729a6
eth,eth/ethconfig,eth,les,light,params: Revert "all: remove notion of…
ziogaschr Jun 8, 2023
2794715
cmd/evm: fix cmd/evm statetest evm and fork flags
ziogaschr Jun 9, 2023
543ffd7
cmd/utils,eth,light,params: fix merge conflict leftovers
ziogaschr Jun 9, 2023
129077e
cmd/faucet: remove faucet getGenesis
ziogaschr Jun 9, 2023
4f59820
eth: use atomic types
ziogaschr Jun 9, 2023
72321ad
internal/ethapi,miner/stress/beacon: use of genesisT,ctypes,vars
ziogaschr Jun 9, 2023
2c3bb58
params: remove uneeded test as we use the Configurator
ziogaschr Jun 12, 2023
1040a99
internal/ethapi: assign reordered expected output for TestRPCMarshalB…
ziogaschr Jun 13, 2023
184178e
cmd/geth: fix TestDAOForkBlockNewChain by using the leveldb as the DB…
ziogaschr Jun 14, 2023
bddc3de
eth/tracers/internal/tracetest: Fix callTracerParityTestRunner by pas…
ziogaschr Jun 14, 2023
46fd16a
internal/ethapi: `make lint` remove unused newRPCTransactionFromBlock…
ziogaschr Jun 14, 2023
2b3f1b0
core/types: add omitempty tag to EffectiveGasPrice
ziogaschr Jun 14, 2023
c89d709
.github/workflows: change revert commit hash on go generate check GH …
ziogaschr Jun 14, 2023
f935076
go.mod,go.sum: go mod tidy
ziogaschr Jun 14, 2023
60f99ff
go.mod,go.sum: fix tests using c-kzg-4844
ziogaschr Jun 21, 2023
cbd2e41
core/types: Revert "core/types: add omitempty tag to EffectiveGasPrice"
ziogaschr Jun 22, 2023
b97a4e6
.github/workflows: Fix go-generate-check for GH action
ziogaschr Jun 22, 2023
bcd0423
Jenkinsfile,README.md,cmd/clef,cmd/devp2p,cmd/echainspec,cmd/faucet,c…
ziogaschr Jul 3, 2023
ff23f74
Merge pull request #552 from etclabscore/feature/drop-kotti
ziogaschr Jul 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/go-generate-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ jobs:
# This way, this script can alert us on any code changes that have to be applied on if file gets changed.
# This commit implements genesis JSON unmarshaling for supported data types.
git revert --no-edit db245033d654c18d5fd82ca7050dc2d72d2d6d0a
# This commit implements omit-empty JSON marshaling for Receipt's effectiveGasPrice field.
git revert --no-edit 1e5b446042262be42637706620b2b353cc97e8cc

- name: Check for modified files
id: git-check
Expand Down
26 changes: 3 additions & 23 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pipeline {
stages {
stage('Notify Github of Pending Jobs') {
steps {
githubNotify context: 'Kotti Regression', description: "${GITHUB_NOTIFY_DESCRIPTION}", status: 'PENDING', account: "${GITHUB_OWNER_NAME}", repo: "${GITHUB_REPO_NAME}", credentialsId: 'meowsbits-github-jenkins', sha: "${GIT_COMMIT}"
githubNotify context: 'Mordor Regression', description: "${GITHUB_NOTIFY_DESCRIPTION}", status: 'PENDING', account: "${GITHUB_OWNER_NAME}", repo: "${GITHUB_REPO_NAME}", credentialsId: 'meowsbits-github-jenkins', sha: "${GIT_COMMIT}"
githubNotify context: 'Goerli Regression', description: "${GITHUB_NOTIFY_DESCRIPTION}", status: 'PENDING', account: "${GITHUB_OWNER_NAME}", repo: "${GITHUB_REPO_NAME}", credentialsId: 'meowsbits-github-jenkins', sha: "${GIT_COMMIT}"
// githubNotify context: 'Classic Regression', description: "${GITHUB_NOTIFY_DESCRIPTION}", status: 'PENDING', account: "${GITHUB_OWNER_NAME}", repo: "${GITHUB_REPO_NAME}", credentialsId: 'meowsbits-github-jenkins', sha: "${GIT_COMMIT}"
Expand All @@ -19,25 +18,6 @@ pipeline {
}
stage("Run Regression Tests") {
parallel {
stage('Kotti') {
agent { label "aws-slave-m5-xlarge" }
steps {
sh "curl -L -O https://go.dev/dl/go1.20.3.linux-amd64.tar.gz"
sh "sudo rm -rf /usr/bin/go && sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.20.3.linux-amd64.tar.gz"
sh "sudo cp /usr/local/go/bin/go /usr/bin/go"
sh "sudo cp /usr/local/go/bin/gofmt /usr/bin/gofmt"
sh "go version"
sh "make geth && ./build/bin/geth version"
sh "rm -rf ${GETH_DATADIR}-kotti"
sh "shasum -a 256 -c ./tests/regression/shasums/kotti.0-2544960.rlp.gz.sha256"
sh "./build/bin/geth --kotti --cache=2048 --nocompaction --nousb --txlookuplimit=1 --datadir=${GETH_DATADIR}-kotti import ${GETH_EXPORTS}/kotti.0-2544960.rlp.gz"
}
post {
always { sh "rm -rf ${GETH_DATADIR}-kotti" }
success { githubNotify context: 'Kotti Regression', description: "${GITHUB_NOTIFY_DESCRIPTION}", status: 'SUCCESS', account: "${GITHUB_OWNER_NAME}", repo: "${GITHUB_REPO_NAME}", credentialsId: 'meowsbits-github-jenkins', sha: "${GIT_COMMIT}" }
unsuccessful { githubNotify context: 'Kotti Regression', description: "${GITHUB_NOTIFY_DESCRIPTION}", status: 'FAILURE', account: "${GITHUB_OWNER_NAME}", repo: "${GITHUB_REPO_NAME}", credentialsId: 'meowsbits-github-jenkins', sha: "${GIT_COMMIT}" }
}
}
stage('Mordor') {
agent { label "aws-slave-m5-xlarge" }
steps {
Expand Down Expand Up @@ -80,11 +60,11 @@ pipeline {
// Commented now because these take a looong time.
// One way of approaching a solution is to break each chain into a "stepladder" of imports, eg. 0-1150000, 1150000-1920000, 1920000-2500000, etc...
// This would allow further parallelization at the cost of duplicated base chaindata stores.
// Since the core focus of testing here is configuration (both user-facing and internal), and one of ugly limitations of our current testnets
// being that they DO NOT reflect the production environment well in this regard (which is a very vulnerable reagard)
// Since the core focus of testing here is configuration (both user-facing and internal), and one of ugly limitations of our current testnets
// being that they DO NOT reflect the production environment well in this regard (which is a very vulnerable reagard)
// another approach might be to condense the chain fork progressions of ETC and ETH into custom test-only chains, perhaps using retestest or a similar
// tool to make transactions and manage chain upgrades dynamically as a transactions are made.
//
//
// stage('Classic') {
// agent { label "aws-slave-m5-xlarge" }
// steps {
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Networks supported by the respective go-ethereum packaged `geth` program.
| | :zap: | Ropsten (Geth+Parity ETH PoW Testnet) | :heavy_check_mark: | :heavy_check_mark: |
| | :handshake: | Rinkeby (Geth-only ETH PoA Testnet) | :heavy_check_mark: | :heavy_check_mark: |
| | :handshake: | Goerli (Geth+Parity ETH PoA Testnet) | :heavy_check_mark: | :heavy_check_mark: |
| | :handshake: | Kotti (Geth+Parity ETC PoA Testnet) | :heavy_check_mark: | |
| | :handshake: | Kovan (Parity-only ETH PoA Testnet) | | |
| | | Tobalaba (EWF Testnet) | | |
| | | Ephemeral development PoA network | :heavy_check_mark: | :heavy_check_mark: |
Expand Down
11 changes: 11 additions & 0 deletions accounts/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,17 @@ func (abi *ABI) EventByID(topic common.Hash) (*Event, error) {
return nil, fmt.Errorf("no event with id: %#x", topic.Hex())
}

// ErrorByID looks up an error by the 4-byte id,
// returns nil if none found.
func (abi *ABI) ErrorByID(sigdata [4]byte) (*Error, error) {
for _, errABI := range abi.Errors {
if bytes.Equal(errABI.ID[:4], sigdata[:]) {
return &errABI, nil
}
}
return nil, fmt.Errorf("no error with id: %#x", sigdata[:])
}

// HasFallback returns an indicator whether a fallback function is included.
func (abi *ABI) HasFallback() bool {
return abi.Fallback.Type == Fallback
Expand Down
28 changes: 28 additions & 0 deletions accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,34 @@ func TestABI_EventById(t *testing.T) {
}
}

func TestABI_ErrorByID(t *testing.T) {
abi, err := JSON(strings.NewReader(`[
{"inputs":[{"internalType":"uint256","name":"x","type":"uint256"}],"name":"MyError1","type":"error"},
{"inputs":[{"components":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"string","name":"b","type":"string"},{"internalType":"address","name":"c","type":"address"}],"internalType":"struct MyError.MyStruct","name":"x","type":"tuple"},{"internalType":"address","name":"y","type":"address"},{"components":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"string","name":"b","type":"string"},{"internalType":"address","name":"c","type":"address"}],"internalType":"struct MyError.MyStruct","name":"z","type":"tuple"}],"name":"MyError2","type":"error"},
{"inputs":[{"internalType":"uint256[]","name":"x","type":"uint256[]"}],"name":"MyError3","type":"error"}
]`))
if err != nil {
t.Fatal(err)
}
for name, m := range abi.Errors {
a := fmt.Sprintf("%v", &m)
var id [4]byte
copy(id[:], m.ID[:4])
m2, err := abi.ErrorByID(id)
if err != nil {
t.Fatalf("Failed to look up ABI error: %v", err)
}
b := fmt.Sprintf("%v", m2)
if a != b {
t.Errorf("Error %v (id %x) not 'findable' by id in ABI", name, id)
}
}
// test unsuccessful lookups
if _, err = abi.ErrorByID([4]byte{}); err == nil {
t.Error("Expected error: no error with this id")
}
}

// TestDoubleDuplicateMethodNames checks that if transfer0 already exists, there won't be a name
// conflict and that the second transfer method will be renamed transfer1.
func TestDoubleDuplicateMethodNames(t *testing.T) {
Expand Down
8 changes: 6 additions & 2 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
return fmt.Errorf("could not fetch parent")
}
// Check transaction validity
signer := types.MakeSigner(b.blockchain.Config(), block.Number())
signer := types.MakeSigner(b.blockchain.Config(), block.Number(), block.Time())
sender, err := types.Sender(signer, tx)
if err != nil {
return fmt.Errorf("invalid transaction: %v", err)
Expand Down Expand Up @@ -913,7 +913,11 @@ func (fb *filterBackend) GetReceipts(ctx context.Context, hash common.Hash) (typ
if number == nil {
return nil, nil
}
return rawdb.ReadReceipts(fb.db, hash, *number, fb.bc.Config()), nil
header := rawdb.ReadHeader(fb.db, hash, *number)
if header == nil {
return nil, nil
}
return rawdb.ReadReceipts(fb.db, hash, *number, header.Time, fb.bc.Config()), nil
}

func (fb *filterBackend) GetLogs(ctx context.Context, hash common.Hash, number uint64) ([][]*types.Log, error) {
Expand Down
17 changes: 16 additions & 1 deletion accounts/abi/bind/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,19 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
// Normalize the method for capital cases and non-anonymous inputs/outputs
normalized := original
normalizedName := methodNormalizer[lang](alias(aliases, original.Name))

// Ensure there is no duplicated identifier
var identifiers = callIdentifiers
if !original.IsConstant() {
identifiers = transactIdentifiers
}
// Name shouldn't start with a digit. It will make the generated code invalid.
if len(normalizedName) > 0 && unicode.IsDigit(rune(normalizedName[0])) {
normalizedName = fmt.Sprintf("M%s", normalizedName)
normalizedName = abi.ResolveNameConflict(normalizedName, func(name string) bool {
_, ok := identifiers[name]
return ok
})
}
if identifiers[normalizedName] {
return "", fmt.Errorf("duplicated identifier \"%s\"(normalized \"%s\"), use --alias for renaming", original.Name, normalizedName)
}
Expand Down Expand Up @@ -182,6 +189,14 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]

// Ensure there is no duplicated identifier
normalizedName := methodNormalizer[lang](alias(aliases, original.Name))
// Name shouldn't start with a digit. It will make the generated code invalid.
if len(normalizedName) > 0 && unicode.IsDigit(rune(normalizedName[0])) {
normalizedName = fmt.Sprintf("E%s", normalizedName)
normalizedName = abi.ResolveNameConflict(normalizedName, func(name string) bool {
_, ok := eventIdentifiers[name]
return ok
})
}
if eventIdentifiers[normalizedName] {
return "", fmt.Errorf("duplicated identifier \"%s\"(normalized \"%s\"), use --alias for renaming", original.Name, normalizedName)
}
Expand Down
23 changes: 23 additions & 0 deletions accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,29 @@ var bindTests = []struct {
t.Errorf("error deploying the contract: %v", err)
}
`,
}, {
name: "NumericMethodName",
contract: `
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;

contract NumericMethodName {
event _1TestEvent(address _param);
function _1test() public pure {}
function __1test() public pure {}
function __2test() public pure {}
}
`,
bytecode: []string{"0x6080604052348015600f57600080fd5b5060958061001e6000396000f3fe6080604052348015600f57600080fd5b5060043610603c5760003560e01c80639d993132146041578063d02767c7146049578063ffa02795146051575b600080fd5b60476059565b005b604f605b565b005b6057605d565b005b565b565b56fea26469706673582212200382ca602dff96a7e2ba54657985e2b4ac423a56abe4a1f0667bc635c4d4371f64736f6c63430008110033"},
abi: []string{`[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_param","type":"address"}],"name":"_1TestEvent","type":"event"},{"inputs":[],"name":"_1test","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"__1test","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"__2test","outputs":[],"stateMutability":"pure","type":"function"}]`},
imports: `
"github.com/ethereum/go-ethereum/common"
`,
tester: `
if b, err := NewNumericMethodName(common.Address{}, nil); b == nil || err != nil {
t.Fatalf("combined binding (%v) nil or error (%v) not nil", b, nil)
}
`,
},
}

Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func NewError(name string, inputs Arguments) Error {
}
}

func (e *Error) String() string {
func (e Error) String() string {
return e.str
}

Expand Down
67 changes: 67 additions & 0 deletions beacon/merkle/merkle.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright 2022 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

// Package merkle implements proof verifications in binary merkle trees.
package merkle

import (
"crypto/sha256"
"errors"
"reflect"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
)

// Value represents either a 32 byte leaf value or hash node in a binary merkle tree/partial proof.
type Value [32]byte

// Values represent a series of merkle tree leaves/nodes.
type Values []Value

var valueT = reflect.TypeOf(Value{})

// UnmarshalJSON parses a merkle value in hex syntax.
func (m *Value) UnmarshalJSON(input []byte) error {
return hexutil.UnmarshalFixedJSON(valueT, input, m[:])
}

// VerifyProof verifies a Merkle proof branch for a single value in a
// binary Merkle tree (index is a generalized tree index).
func VerifyProof(root common.Hash, index uint64, branch Values, value Value) error {
hasher := sha256.New()
for _, sibling := range branch {
hasher.Reset()
if index&1 == 0 {
hasher.Write(value[:])
hasher.Write(sibling[:])
} else {
hasher.Write(sibling[:])
hasher.Write(value[:])
}
hasher.Sum(value[:0])
if index >>= 1; index == 0 {
return errors.New("branch has extra items")
}
}
if index != 1 {
return errors.New("branch is missing items")
}
if common.Hash(value) != root {
return errors.New("root mismatch")
}
return nil
}
44 changes: 44 additions & 0 deletions beacon/params/params.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2022 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package params

const (
EpochLength = 32
SyncPeriodLength = 8192

BLSSignatureSize = 96
BLSPubkeySize = 48

SyncCommitteeSize = 512
SyncCommitteeBitmaskSize = SyncCommitteeSize / 8
SyncCommitteeSupermajority = (SyncCommitteeSize*2 + 2) / 3
)

const (
StateIndexGenesisTime = 32
StateIndexGenesisValidators = 33
StateIndexForkVersion = 141
StateIndexLatestHeader = 36
StateIndexBlockRoots = 37
StateIndexStateRoots = 38
StateIndexHistoricRoots = 39
StateIndexFinalBlock = 105
StateIndexSyncCommittee = 54
StateIndexNextSyncCommittee = 55
StateIndexExecPayload = 56
StateIndexExecHead = 908
)
Loading