Commit graph

14035 commits

Author SHA1 Message Date
Daniel Liu
d749d54ea5
feate(core, trie): add UpdateContractCode to the Trie interface #27476 (#1167)
Verkle trees store the code inside the trie. This PR changes the interface to pass the code, as well as the dirty flag to tell the trie package if the code is dirty and needs to be updated. This is a no-op for the MPT and the odr trie.

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2026-02-05 11:43:04 +05:30
Daniel Liu
9cf795c908
perf: improve state reader with error handling and committed flag #27428 (#1166)
- Add error returns to Database.Reader() and NodeIterator() methods
- Introduce committed flag to prevent usage of tries after commit
- Update callers to handle new error signatures
- Add MustNodeIterator() helper for backward compatibility

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-02-03 20:55:53 +05:30
Daniel Liu
76a53321df
common: fix block numbers for EIP-1559 and cancun (#2020) 2026-01-30 21:06:15 +08:00
Daniel Liu
7ce60a2a79
rpc: add a rpc.rangelimit flag #33163 (#1957) 2026-01-29 11:50:58 +05:30
Daniel Liu
e77ac510d0
all: replace Div/Mul with Rsh/Lsh if possible #29911 (#1966) 2026-01-29 11:31:58 +05:30
Daniel Liu
d12f9803eb
trie: remove parameter 'fromLevel' in Prove #27512 (#1165)
This removes the feature where top nodes of the proof can be elided.
It was intended to be used by the LES server, to save bandwidth
when the client had already fetched parts of the state and only needed
some extra nodes to complete the proof. Alas, it never got implemented
in the client.

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-01-29 11:29:02 +05:30
Daniel Liu
222d180a6b
trie: update func ForEachWithOrder #27496 #27909 (#1163)
Co-authored-by: Dan Laine <daniel.laine@avalabs.org>
Co-authored-by: Felix Lange <fjl@twurst.com>
2026-01-29 11:28:36 +05:30
Daniel Liu
a74b7e2466
core/vm: reuse Memory instances #30137 #33056 (#1974) 2026-01-29 11:27:13 +05:30
Daniel Liu
4768d00e1e
eth/filters, cmd: add config of eth_getLogs address limit #33320 #32327 (#1961)
* eth/filters: change error code for invalid parameter errors #33320

* eth/filters, cmd: add config of eth_getLogs address limit #32327
2026-01-29 11:26:45 +05:30
Daniel Liu
84aedaa7bf
core/txpool/legacypool: fix stale counter #33653 (#1990) 2026-01-29 11:25:55 +05:30
Daniel Liu
7fd5927081
accounts/scwallet: fix panic in decryptAPDU #33606 (#1982)
Validate ciphertext length in decryptAPDU, preventing runtime panics on
invalid input.

Co-authored-by: DeFi Junkie <deffie.jnkiee@gmail.com>
2026-01-29 11:25:27 +05:30
Daniel Liu
ecb0408521
core/state: ensure deterministic hook emission order in Finalise #33644 (#1981) 2026-01-29 11:23:33 +05:30
Daniel Liu
0206909058
core/txpool/legacypool: add metric for accounts in txpool #33646 (#1980) 2026-01-29 11:22:31 +05:30
Daniel Liu
b5e617fee0
internal/debug: add integration with Grafana Pyroscope #33623 (#1983) 2026-01-29 11:22:03 +05:30
Daniel Liu
ab39386242
core/types: fix panic on invalid signature length #33647 (#1979)
Replace panic with error return in decodeSignature to prevent crashes on
invalid inputs, and update callers to propagate the error.

Co-authored-by: DeFi Junkie <deffie.jnkiee@gmail.com>
2026-01-27 08:55:23 +05:30
Daniel Liu
105044559b
vm: simplify error handling in vm.EVM.create() #30292 (#1973) 2026-01-27 08:54:08 +05:30
wit liu
b1c239de97
common, core: fix goimports warning (#1972) 2026-01-27 08:53:31 +05:30
Daniel Liu
5190df67d8
core/vm: use uint64 in Memory for indices everywhere #30252 (#1971) 2026-01-27 08:53:03 +05:30
Daniel Liu
7c5cd0a0f9
core/vm: improved stack swap performance #30249 (#1970) 2026-01-27 08:52:42 +05:30
Daniel Liu
2e0e142d2b
params: fix wrong comment #33503 (#1965) 2026-01-27 08:47:30 +05:30
Daniel Liu
b6ae09a36c
accounts/abi/bind/v2: replace rng in test #33612 (#1964) 2026-01-27 08:47:13 +05:30
Daniel Liu
3ce9a1980a
core/vm: fix typo (#1963) 2026-01-27 08:46:49 +05:30
Daniel Liu
bd42edee0b
eth/filters: fix error when blockHash is used with fromBlock/toBlock #31877 (#1962) 2026-01-27 08:46:24 +05:30
Daniel Liu
5811eb69ce
cmd/XDC, internal/flags: update copyright year to 2026 (#1943) 2026-01-27 08:45:46 +05:30
Daniel Liu
acec2ccc5b
cicd: fix docker build error (#1978) 2026-01-27 08:44:41 +05:30
Daniel Liu
373eb2dc36
common/bitutil: deprecate XORBytes in favor of stdlib crypto/subtle #33331 (#1952)
XORBytes was added to package crypto/subtle in Go 1.20, and it's faster
than our bitutil.XORBytes. There is only one use of this function
across go-ethereum so we can simply deprecate the custom implementation.

---------

Co-authored-by: cui <cuiweixie@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2026-01-26 18:07:20 +05:30
Daniel Liu
3518be8c8b
core/state: move slot RLP encoding into the MPT implementation #27000 (#1162)
Continuing with a series of PRs to make the Trie interface more generic, this PR moves
the RLP encoding of storage slots inside the StateTrie and light.Trie implementations,
as other types of tries don't use RLP.

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2026-01-26 18:04:50 +05:30
Daniel Liu
e40208f3db
trie: new empty trie with types.EmptyRootHash instead of null #27230 (#1160) 2026-01-26 18:04:14 +05:30
Wanwiset Peerapatanapokin
4a35cdc6b0
add private chain test checkbox (#1988) 2026-01-26 13:18:53 +05:30
Daniel Liu
3d194d4303
all: port boring changes from pbss #27176 (#1158)
* all: port boring changes from pbss

* core, trie: address comments from martin

* trie: minor fixes

* core/rawdb: update comment

* core, eth, tests, trie: address comments

* tests, trie: add extra check when update trie database

* trie/triedb/hashdb: degrade the error to warning

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-01-26 11:21:46 +05:30
Daniel Liu
43b005c479
txpool: make unreserve idempotent to avoid false non-reserved errors, fix #1975 (#1976) 2026-01-26 11:20:33 +05:30
Daniel Liu
a1b0d5476d
core/txpool: add 7702 protection to blobpool #31526 (#1930) 2026-01-26 11:20:02 +05:30
Daniel Liu
48b6063261
core/txpool/legacypool: reject gapped tx from delegated account #31430 (#1928) 2026-01-21 13:28:23 +05:30
Daniel Liu
96a9c89aa6
core/txpool: move setcode tx validation into legacyPool #31209 (#1927) 2026-01-21 11:13:10 +05:30
Daniel Liu
1f3faa5184
all: set gas limit dynamically (#1945) 2026-01-21 10:49:20 +05:30
Daniel Liu
c27d49c03e
core/txpool/legacypool: add setCodeTx reorg test #31206 (#1924) 2026-01-21 10:48:47 +05:30
Daniel Liu
1b7d4afdd3
trie: add node type common package #27160 (#1150)
* trie: add node type common package

In trie/types package, a few node wrappers are defined, which will be used
in both trie package, trie/snap package, etc. Therefore, a standalone common
package is created to put these stuffs.

* trie: rename trie/types to trie/trienode

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-01-21 10:47:53 +05:30
Daniel Liu
060a0e4810
ethclient: omit nil address/topics from filter args #33464 (#1942) 2026-01-19 14:20:01 +05:30
Daniel Liu
217b069ec0
core/txpool, types: add support for SetCode transactions #31073 (#1922) 2026-01-19 14:19:34 +05:30
Daniel Liu
df83610a30
cmd: fix flag variable name (#1958) 2026-01-19 14:05:55 +05:30
Daniel Liu
3742ed7f2f
core/vm: check if read-only in gas handlers #33281 (#1960) 2026-01-19 14:05:27 +05:30
Daniel Liu
fcd9685c87
core/vm: return early in selfdestruct gas calculation #33450 (#1959) 2026-01-19 14:04:58 +05:30
Daniel Liu
cb48e25ccf
core/txpool: declare address already reserved error #29095 (#1920) 2026-01-19 12:18:08 +05:30
Daniel Liu
f0b523d635
core/vm: remove a redundant zero check in opAddmod #29672 (#1954)
Co-authored-by: Aaron Chen <aaronchen.lisp@gmail.com>
2026-01-19 12:16:20 +05:30
Daniel Liu
bef85ec37b
console/prompt: use PromptInput in PromptConfirm method #33445 (#1953)
Co-authored-by: oooLowNeoNooo <ooolowneonooo@gmail.com>
2026-01-19 12:15:27 +05:30
Daniel Liu
b4cbf663a7
accounts/keystore: fix panic in decryptPreSaleKey #33602 (#1951)
Validate ciphertext length in decryptPreSaleKey, preventing runtime
panics on invalid input.

Co-authored-by: DeFi Junkie <deffie.jnkiee@gmail.com>
2026-01-19 12:15:03 +05:30
Daniel Liu
0d76b69517
accounts/abi: check presence of payable fallback or receive before proceeding with transfer #32374 (#1950)
remove todo

Co-authored-by: cui <cuiweixie@gmail.com>
2026-01-19 12:14:44 +05:30
Daniel Liu
f5d921bad2
accounts/abi/bind: fix data race in TestWaitDeployedCornerCases #32740 #33041 (#1949) 2026-01-19 12:13:50 +05:30
Daniel Liu
0c306686bb
rpc: fix limitedBuffer.Write to properly enforce size limit (#33545) (#1948)
Updated the `avail` calculation to correctly compute remaining capacity:
`buf.limit - len(buf.output)`, ensuring the buffer never exceeds its
configured limit regardless of how many times `Write()` is called.

Co-authored-by: Maxim Evtush <154841002+maximevtush@users.noreply.github.com>
2026-01-19 12:13:15 +05:30
Daniel Liu
03da570aca
crypto/ecies: use aes blocksize (#1946)
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-01-19 11:25:15 +05:30