Commit graph

2216 commits

Author SHA1 Message Date
Daniel Liu
e9043cceb2
refactor(txpool/legacypool): remove ErrAlreadyKnown in legacypool #28400 (#2127) 2026-03-10 18:45:30 +05:30
Daniel Liu
c8f241ce15
docs(core/txpool/legacypool): fix typos #28258 (#2126) 2026-03-10 18:45:06 +05:30
Daniel Liu
d4a6f43ef2
refactor(core/txpool): migrate tx subscription to SubscribeTransactions #28243 (#2125)
* refactor(txpool): remove wrapper type #27841

Partial backport of ethereum/go-ethereum PR #27841, limited to txpool wrapper removal.

- Migrate txpool interfaces/call sites from `*txpool.Transaction` to `*types.Transaction`
- Update eth/miner/contracts paths and related tests accordingly
- No intended behavior change

Blob sidecar validation/handling changes from upstream are not included here.

* refactor(core/txpool): migrate tx subscription to SubscribeTransactions #28243

Replace the old SubscribeNewTxsEvent-style plumbing with the new
SubscribeTransactions(ch, reorgs) interface across txpool, eth protocol
manager, API backend, miner worker, and test helpers.

Key changes:
- Extend txpool/subpool tx subscription interface with a reorgs flag
- Route eth tx announcement path to reorgs=false (new tx announcements only)
- Route API/miner subscriptions to reorgs=true
- Move subscription-scope cleanup to TxPool.Close()
- Add Gas field to LazyTransaction in legacy pending view

Note:
LegacyPool currently cannot strictly separate newly seen and resurrected txs,
so the reorgs flag is accepted for API compatibility and future blob-subpool
integration.
2026-03-10 18:44:38 +05:30
Daniel Liu
5bb1f035a2
feat(core/vm): implement EIP-7883 - ModExp Gas Cost Increase #31606 #32015 (#2123)
https://eips.ethereum.org/EIPS/eip-7883

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2026-03-10 18:43:55 +05:30
Daniel Liu
8331c1431f
refactor(params): rename AllXDPoSProtocolChanges to AllDevChainProtocolChanges (#2054) 2026-03-10 18:42:26 +05:30
Daniel Liu
e02bc0723a
refactor(core): semantic journalling #28880 (#2081)
This is a follow-up to #29520, and a preparatory PR to a more thorough
change in the journalling system.

This PR hides the journal-implementation details away, so that the
statedb invokes methods like `JournalCreate`, instead of explicitly
appending journal-events in a list. This means that it's up to the
journal whether to implement it as a sequence of events or
aggregate/merge events.

This PR also makes it so that management of valid snapshots is moved
inside the journal, exposed via the methods `Snapshot() int` and
`RevertToSnapshot(revid int, s *StateDB)`.

JournalSetCode journals the setting of code: it is implicit that the
previous values were "no code" and emptyCodeHash. Therefore, we can
simplify the setCode journal.

The self-destruct journalling is a bit strange: we allow the
selfdestruct operation to be journalled several times. This makes it so
that we also are forced to store whether the account was already
destructed.

What we can do instead, is to only journal the first destruction, and
after that only journal balance-changes, but not journal the
selfdestruct itself.

This simplifies the journalling, so that internals about state
management does not leak into the journal-API.

Preimages were, for some reason, integrated into the journal management,
despite not being a consensus-critical data structure. This PR undoes
that.

---------

Co-authored-by: Martin HS <martin@swende.se>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-03-07 17:42:10 +05:30
Daniel Liu
4f599282b3
fix(core): remove slot dirtyness if it's set back to origin value #29731 #31874 (#2080) 2026-03-06 13:25:30 +05:30
Daniel Liu
d542efe08d
feat(core/vm): implement EIP-7823 - Set upper bounds for MODEXP #31818 #32363 (#2119) 2026-03-06 11:24:22 +05:30
Daniel Liu
5695f8a712
perf(core): reduce alloc #33576 (#2085) 2026-03-06 11:17:47 +05:30
Daniel Liu
275424c44f
fix(core): revert pending storage updates if they revert to original #29661 (#2079)
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2026-03-06 11:16:03 +05:30
Daniel Liu
3eb198b1a5
refactor(core): storage journal entry should revert dirtyness too #29641 (#2078)
Currently our state journal tracks each storage update to a contract, having the ability to revert those changes to the previously set value.

For the very first modification however, it behaves a bit wonky. Reverting the update doesn't actually remove the dirty-ness of the slot, rather leaves it as "change this slot to it's original value". This can cause issues down the line with for example write witnesses needing to gather an unneeded proof.

This PR modifies the storageChange journal entry to not only track the previous value of a slot, but also whether there was any previous value at all set in the current execution context. In essence, the PR changes the semantic of storageChange so it does not simply track storage changes, rather it tracks dirty storage changes, an important distinction for being able to cleanly revert the journal item.

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2026-03-06 11:15:44 +05:30
Daniel Liu
ad0eea0f07
refactor(crypto): vendor in golang.org/x/crypto/sha3 #33323 (#2046)
The upstream libray has removed the assembly-based implementation of
keccak. We need to maintain our own library to avoid a peformance
regression.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
2026-02-28 17:23:57 +04:00
Daniel Liu
3454841ade
fix(core): hex encode validators/validator/penalties in Header JSON (#2057)
Ensure JSON marshal/unmarshal uses hex for validators, validator, and penalties so Header encoding is consistent with RPC output.
2026-02-28 16:56:37 +04:00
Daniel Liu
240b318dfb
feat(core): extends tracing.Hooks with OnSystemCallStartV2 #30786 (#2073) 2026-02-28 16:55:51 +04:00
Daniel Liu
d754f363e5
core/state: remove account reset operation v2 #29520 (#1934) 2026-02-24 14:17:27 +05:30
Daniel Liu
fabfd1c485
perf(core): track state change set with account address #27815 (#2076) 2026-02-24 13:49:17 +05:30
Daniel Liu
edec80c08f
refactor(core): make stateobject.create selfcontain #28459 (#2074) 2026-02-24 13:48:29 +05:30
Daniel Liu
677f923125
refactor(all): track state changes in state db #27349 (#1947) 2026-02-24 10:27:31 +05:30
Daniel Liu
3211c8ef2f
perf(core): speed up push and interpreter loop #30662 (#2032) 2026-02-23 07:21:05 +05:30
Daniel Liu
9f720806e1
refactor(core): remove unnecessary parameters #30776 (#2068) 2026-02-20 13:51:30 +05:30
Daniel Liu
cfca45a7eb
refactor(all): rework EVM constructor #30745 (#2065) 2026-02-17 14:35:18 +05:30
Daniel Liu
398d9b693d
refactor(core): make signature of ContractCode hash-independent #27209 (#1169) 2026-02-13 09:11:43 +05:30
Daniel Liu
e96ec6aab5
fix(core): remove vm.AccountRef (#2055) 2026-02-12 14:57:04 +05:30
Daniel Liu
cc2109342c
feat(core): implement EIP-2935 #29465 #30924 (#2033) 2026-02-12 09:01:26 +05:30
Daniel Liu
50210d90e3
refactor(all): remove term whitelist and blacklist (#1994) 2026-02-10 17:09:21 +05:30
Daniel Liu
85f2bebfd1
refactor(all): move genesis initialization to blockchain #25523 (#2018) 2026-02-10 16:56:34 +05:30
Daniel Liu
35d5bbd240
fix(core): remove panic when address is not present #30414 (#2029) 2026-02-10 16:52:38 +05:30
Daniel Liu
ec697ddbdb
core/vm: implement EIP-7939: CLZ opcode #31989 (#2012) 2026-02-10 16:51:20 +05:30
Daniel Liu
d7a42cb038
refactor(core): clean up EVM environmental structure #31061 (#1985) 2026-02-10 16:40:54 +05:30
Daniel Liu
81ac9cfb7e
fix(core): fix genesis error in #2019 (#2034) 2026-02-10 12:22:17 +08:00
Daniel Liu
e39a523260
refactor(all): cleanup the APIs for initializing genesis #25473 #26747 (#2017)
* refactor(all): cleanup the APIs for initializing genesis #25473

* fix(core): fix accessor mismatch for genesis state #26747
2026-02-07 00:18:39 +05:30
Daniel Liu
f744e86dd7
feat(core): add ContractCode to the OpContext #30466 (#2030) 2026-02-07 00:15:38 +05:30
Daniel Liu
29ad6db3bd
ci: validate gofmt, tidy, and generated files before test (#2022)
Check

- gofmt
- go mod tidy
- generated files

before tests.
2026-02-06 14:43:52 +05:30
Daniel Liu
7e12f036cc
refactor(core): harden SetupGenesisBlock flows (#2019)
- handle missing genesis header/state and validate stored hash
- avoid overwriting unchanged chain config; keep private net config
- extend TestSetupGenesis for missing header/state/config/head cases
2026-02-06 14:41:29 +05:30
Daniel Liu
75c05e5dde
feat(params): start osaka fork #31125 (#2013) 2026-02-06 14:40:58 +05:30
Daniel Liu
9dba15a673
feat(core): implement EIP-7623 increase calldata cost 30946 (#2031)
Link to spec: https://eips.ethereum.org/EIPS/eip-7623

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
2026-02-05 14:45:11 +05:30
Daniel Liu
d74c23cca1
perf(core): use uint256 in state #28598 (#1977) 2026-02-05 13:59:23 +05:30
Daniel Liu
1655f801d1
core/vm: add read only protection for opcodes #33637 (#1984) 2026-02-05 12:57:40 +05:30
Daniel Liu
934c8d0679
perf(all): use big.Int.Sign() to compare with 0 (#1969) 2026-02-05 11:45:44 +05:30
Daniel Liu
a51eaa7200
fix(core, trie): revert error removal in (*state.Trie).Commit #27544 (#1168)
* trie, core/state: revert error removal in (*state.Trie).Commit

* Gary's nitpick :)



---------

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-02-05 11:43:33 +05:30
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
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
a74b7e2466
core/vm: reuse Memory instances #30137 #33056 (#1974) 2026-01-29 11:27:13 +05:30
Daniel Liu
84aedaa7bf
core/txpool/legacypool: fix stale counter #33653 (#1990) 2026-01-29 11:25:55 +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
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