Seungbae Yu
5fb463dddc
core: preallocate batch size in bloomIndexer ( #25289 )
...
This change reduces allocations when committing bloombits indexes
by creating the database batch with a larger initial size.
2 years ago
yong
6b6261b51f
core/types: fix typo in comment ( #25359 )
2 years ago
Péter Szilágyi
6fd06ab075
cmd, core, eth, les, params: add merge-passed chain config ( #24538 )
...
* cmd, core, eth, les, params: add merge-passed chain config
* eth/catalyst, params: add various warning on malfunctioning beacons
* eth/catalyst: fix warning for beacons without transition exchanges
2 years ago
rjl493456442
9d76a9b94f
core, trie, eth, cmd: rework preimage store ( #25287 )
...
* core, trie, eth, cmd: rework preimage store
* trie: address comment
2 years ago
Marius van der Wijden
c6dcd018d2
core: eth: rpc: implement safe rpc block ( #25165 )
...
* core: eth: rpc: implement safe rpc block
* core: fix setHead, panics
2 years ago
Péter Szilágyi
f3af3fd8df
eth: support bubbling up bad blocks from sync to the engine API ( #25190 )
...
* eth: support bubbling up bad blocks from sync to the engine API
* eth/catalyst: fix typo
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
* eth/catalyst: fix typo
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
* Update eth/catalyst/api.go
* eth/catalyst: when forgetting bad hashes, also forget descendants
* eth/catalyst: minor bad block tweaks for resilience
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2 years ago
Delweng
b196ad1c16
all: add whitespace linter ( #25312 )
...
* golangci: typo
Signed-off-by: Delweng <delweng@gmail.com>
* golangci: add whietspace
Signed-off-by: Delweng <delweng@gmail.com>
* *: rm whitesapce using golangci-lint
Signed-off-by: Delweng <delweng@gmail.com>
* cmd/puppeth: revert accidental resurrection
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2 years ago
Marius van der Wijden
22d71afc95
params: set sepolia mergeNetsplitBlock to 1735371 ( #25372 )
2 years ago
rjl493456442
1657e43931
core, les, eth: port snap sync changes ( #24898 )
...
core, eth, les, trie: rework snap sync
2 years ago
Lee Bousfield
1c9afc56ae
core: prevent negative fee during RPC calls ( #25214 )
...
During RPC calls such as eth_call and eth_estimateGas, st.evm.Config.NoBaseFee is set
which allows the gas price to be below the base fee. This results the tip being negative,
and balance being subtracted from the coinbase instead of added to it, which results in a
potentially negative coinbase balance interestingly. This can't happen during normal chain
processing as outside of RPC calls the gas price is required to be at least the base fee,
as NoBaseFee is false.
This change prevents this behavior by disabling fee payment when the fee is not set.
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2 years ago
henridf
4766b1107f
core: remove lock in BlockChain.ExportN ( #25254 )
...
* Remove locking in (*BlockChain).ExportN
Since ExportN is read-only, it shouldn't need the lock. (?)
* Add hash check to detect reorgs during export.
* fix check order
* Update blockchain.go
* Update blockchain.go
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2 years ago
Seungbae.yu
44893be0d6
core, eth: pre-allocate map in storage copy ( #25279 )
2 years ago
Seungbae.yu
e394d01f2a
core/types: fix typo in comment ( #25249 )
2 years ago
Marius van der Wijden
87bb5db675
core: allow external processor ( #25233 )
2 years ago
Marius van der Wijden
5f6e870ee6
core: apply ttd override to uninitialized db ( #25136 )
...
* core: apply ttd override to genesis block
* core: apply overrides properly
2 years ago
Marius van der Wijden
e537193421
core: allow external code to set the block validator for malicious tests ( #25119 )
...
* core: don't validate state
* core: allow external validator
* core: revert
* core: comments
* Update blockchain_reader.go
* core: move SetValidator to blockchain.go
* core: rename method
2 years ago
Seungbae.yu
2697e44d81
all: change format `0x%x` to `%#x` ( #25221 )
2 years ago
Marius van der Wijden
d12b1a91cd
consensus/beacon: check that only the latest pow block is valid ttd block ( #25187 )
...
* consensus/beacon: check that only the latest pow block is valid ttd block
* consensus/beacon: move verification to async function
* consensus/beacon: fix verifyTerminalPoWBlock, add test cases
* consensus/beacon: cosmetic changes
* consensus/beacon: apply karalabe's fixes
2 years ago
aaronbuchwald
300f6121ad
core/rawdb: simplify TestDiskSeek to use memorydb ( #25182 )
2 years ago
Ruohui Wang
3f712e7447
core/rawdb: fix typo in comment ( #25191 )
2 years ago
aaronbuchwald
68420e1aa5
core: fix typo in txpool ( #25149 )
...
Fix typo in txPool truncateQueue comment
2 years ago
Marius van der Wijden
d8f963811d
cmd, params: implement Gray Glacier hard-fork (EIP-5133) ( #25088 )
...
* cmd/geth, params: implement Gray Glacier (EIP-5133)
* cmd/evm: add gray glacier tests
* params: nitpicks
* params: fixes
2 years ago
lmittmann
bc013bc42e
all: prefer `new(big.Int)` over `big.NewInt(0)` ( #25087 )
...
minor performance improvement: `big.NewInt(0).Xxx` -> `new(big.Int).Xxx`
2 years ago
Martin Holst Swende
a907d7e81a
all: more linters ( #24783 )
...
This enables the following linters
- typecheck
- unused
- staticcheck
- bidichk
- durationcheck
- exportloopref
- gosec
WIth a few exceptions.
- We use a deprecated protobuf in trezor. I didn't want to mess with that, since I cannot meaningfully test any changes there.
- The deprecated TypeMux is used in a few places still, so the warning for it is silenced for now.
- Using string type in context.WithValue is apparently wrong, one should use a custom type, to prevent collisions between different places in the hierarchy of callers. That should be fixed at some point, but may require some attention.
- The warnings for using weak random generator are squashed, since we use a lot of random without need for cryptographic guarantees.
2 years ago
Gustavo Silva
eb94896270
Chore: Minimal gramatical errors (signleton -> singleton) ( #25057 )
...
core: fix typos
2 years ago
int88
594e321662
core/evm: fix error in comment ( #25040 )
...
Co-authored-by: Martin Holst Swende <martin@swende.se>
2 years ago
henridf
f5037185aa
core/types: improve LogForStorage and ReceiptForStorage comments ( #25032 )
...
Co-authored-by: Felix Lange <fjl@twurst.com>
2 years ago
Rajaram Gaunker
6160296445
core/types: remove unused field 'td' in Block ( #25010 )
2 years ago
Péter Szilágyi
41e75480df
eth, les, params: log chain config a bit saner ( #24904 )
...
Previously on Geth startup we just logged the chain config is a semi-json-y format. Whilst that worked while we had a handful of hard-forks defined, currently it's kind of unwieldy.
This PR converts that original data dump and converts it into a user friendly - alas multiline - log output.
2 years ago
rjl493456442
22defa5af7
all: introduce trie owner notion ( #24750 )
...
* cmd, core/state, light, trie, eth: add trie owner notion
* all: refactor
* tests: fix goimports
* core/state/snapshot: fix ineffasigns
Co-authored-by: Martin Holst Swende <martin@swende.se>
2 years ago
Martin Holst Swende
c375ee91e9
cmd/geth, core/state/snapshot: rework journal loading, implement account-check ( #24765 )
...
* cmd/geth, core/state/snapshot: rework journal loading, implement account-check
* core/state/snapshot, cmd/geth: polish code (#37 )
* core/state/snapshot: minor nits
* core/state/snapshot: simplify error logic
* cmd/geth: go format
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2 years ago
Paweł Bylica
997f1c4f0a
core/vm: optimize jumpdest analysis ( #23500 )
...
core/vm: optimize PUSH opcode discrimination
2 years ago
Martin Holst Swende
d8a2305565
eth/tracers: add support for block overrides in debug_traceCall ( #24871 )
...
This PR adds support for block overrides when doing debug_traceCall.
- Previously, debug_traceCall against pending erroneously used a common.Hash{} stateroot when looking up the state, meaning that a totally empty state was used -- so it always failed,
- With this change, we reject executing debug_traceCall against pending.
- And we add ability to override all evm-visible header fields.
2 years ago
rjl493456442
f9806dc872
core: fix canonical hash marker update ( #24996 )
...
* core: fix reorg
* core: revert change for memory efficiency
* core: revert changes
2 years ago
Marius van der Wijden
8c0c0434c9
core/beacon: prevent invalid logsBloom length panic ( #24946 )
...
* core/beacon: prevent invalid logsBloom length panic
* core/beacon: prevent negative baseFeePerGas
* Update core/beacon/types.go
Co-authored-by: Martin Holst Swende <martin@swende.se>
* eth/catalys: go format
Co-authored-by: Martin Holst Swende <martin@swende.se>
2 years ago
Marius van der Wijden
86af788790
core: use less memory during reorgs ( #24616 )
...
This PR significantly reduces the memory consumption of a long reorg
2 years ago
Felix Lange
9244d5cd61
all: update license headers and AUTHORS from git history ( #24947 )
2 years ago
rjl493456442
59ac229f87
core/state/snapshot: detect and clean up dangling storage snapshot in generation ( #24811 )
...
* core/state/snapshot: check dangling storages when generating snapshot
* core/state/snapshot: polish
* core/state/snapshot: wipe the last part of the dangling storages
* core/state/snapshot: fix and add tests
* core/state/snapshot: fix comment
* README: remove mentions of fast sync (#24656 )
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
* core, cmd: expose dangling storage detector for wider usage
* core/state/snapshot: rename variable
* core, ethdb: use global iterators for snapshot generation
* core/state/snapshot: polish
* cmd, core/state/snapshot: polish
* core/state/snapshot: polish
* Update core/state/snapshot/generate.go
Co-authored-by: Martin Holst Swende <martin@swende.se>
* ethdb: extend db test suite and fix memorydb iterator
* ethdb/dbtest: rollback changes
* ethdb/memorydb: simplify iteration
* core/state/snapshot: update dangling counter
* core/state/snapshot: release iterators
* core/state/snapshot: update metrics
* core/state/snapshot: update time metrics
* metrics/influxdb: temp solution to present counter meaningfully, remove it
* add debug log, revert later
* core/state/snapshot: fix iterator panic
* all: customized snapshot iterator for backward iteration
* core, ethdb: polish
* core/state/snapshot: remove debug log
* core/state/snapshot: address comments from peter
* core/state/snapshot: reopen the iterator at the next position
* ethdb, core/state/snapshot: address comment from peter
* core/state/snapshot: reopen exhausted iterators
Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>
3 years ago
Péter Szilágyi
34bda5eae3
core, eth, les, rpc: polish catalyst errors, add context
3 years ago
Marius van der Wijden
4a4d531052
eth/catalyst: update implementation to spec ( #24802 )
...
* eth/catalyst: return invalid payload attributes error
* eth/catalyst: implement LVH as specified, add tests
* eth/catalyst: return current block hash not header hash
* eth/catalyst: fix test
* eth/catalyst: bring error codes in line with spec
3 years ago
zhaochonghe
2bfd9a28d1
core: fix the order of address in queue ( #24907 )
...
reverse the order of address in queue
3 years ago
Sina Mahmoodi
bf693228a3
eth/tracers/js: goja tracer ( #23773 )
...
This adds a JS tracer runtime environment based on the Goja VM. The new
runtime replaces the duktape runtime, which will be removed soon.
Goja is implemented in Go and is faster for cases where the Go <-> JS
transition overhead dominates overall performance. It is faster because
duktape is written in C, and the transition cost includes the cost of using
cgo. Another reason for using Goja is that go-duktape is not maintained
anymore.
We expect the performace of JS tracing to be at least as good or better with
this change.
3 years ago
Marius van der Wijden
e6fa102eb0
core, eth, internal, rpc: implement final block ( #24282 )
...
* eth: core: implement finalized block
* eth/catalyst: fix final block
* eth/catalyst: update finalized head gauge
* internal/jsre/deps: updated web3.js to allow for finalized block
* eth/catalyst: make sure only one thread can call fcu
* eth/catalyst: nitpicks
* eth/catalyst: use plain mutex
* eth: nitpicks
3 years ago
Håvard Anda Estensen
4b309c7006
all: replace non-trivial uses of package ioutil with os ( #24886 )
...
Co-authored-by: Martin Holst Swende <martin@swende.se>
3 years ago
Håvard Anda Estensen
e644d45c14
all: use strings.EqualFold for string comparison ( #24890 )
3 years ago
Marius van der Wijden
381c66caf0
eth/catalyst: set the correct LatestValidHash ( #24855 )
...
* eth/catalyst: set the correct LatestValidHash
* eth/catalyst: core: return LVH during reorg, rework invalid teminal block
* eth/catalyst: nitpicks
3 years ago
Qian Bin
fe5a26733c
core/vm: reduce overhead in instructions-benchmark ( #24860 )
...
* core/vm: reduce footprint of OP benchmark
* core/vm: for opBenchmark, add code to detect inputs mutation
* Update core/vm/instructions_test.go
Co-authored-by: Martin Holst Swende <martin@swende.se>
* core/vm: opBenchmark, stop timer before sanity-test code
Co-authored-by: Martin Holst Swende <martin@swende.se>
3 years ago
Håvard Anda Estensen
07508ac0e9
all: replace uses of ioutil with io and os ( #24869 )
3 years ago
s7v7nislands
330e53fbb9
core/asm: use strings.Builder and fix godoc issues ( #24861 )
3 years ago
Martin Holst Swende
97f308a98f
core/vm: for tracing, do not report post-op memory
3 years ago