Commit graph

13925 commits

Author SHA1 Message Date
Daniel Liu
639531aae9
contracts, tests: fix global variable modifications and remove unsafe parallelism (#1882)
Add defer cleanup for global variables and remove t.Parallel() where
global state is modified to prevent race conditions and test pollution.

Changes:

1. tests/vm_test.go:
   - Add defer to restore common.TIPXDCXCancellationFee
   - Remove t.Parallel() since modifying global variable makes concurrent
     execution unsafe, even with defer cleanup
   - Prevents potential race conditions with other tests in the package

2. contracts/tests/Inherited_test.go:
   - Add defer to restore common.TIPXDCXCancellationFee
   - No t.Parallel() present, so safe with defer alone

3. contracts/trc21issuer/trc21issuer_test.go:
   - Add defer to restore common.TRC21IssuerSMC (was missing)
   - Fix existing bug: restore correct variable common.TRC21GasPriceBefore
     instead of common.TIPTRC21Fee
   - Remove unused variables: token, delay

Rationale for removing t.Parallel():
While defer ensures cleanup after test completion, during test execution
the modified global variable is visible to all concurrent tests. Even
though tests/vm_test.go is currently the only test modifying
TIPXDCXCancellationFee, removing t.Parallel() is the safer approach to
ensure complete test isolation and prevent timing-dependent behavior.

This follows the same principles as the txpool MinGasPrice fix: global
variable modifications should not occur during concurrent test execution.
2025-12-22 12:00:39 +05:30
Daniel Liu
e2da8daab4
core/types: updates for EIP-7702 API functions #30933 (#1827) 2025-12-20 11:13:04 +05:30
Daniel Liu
510be504ef
eth/tracers: prestate lookup EIP7702 delegation account #32080 (#1828)
Implement https://github.com/ethereum/go-ethereum/issues/32078
Parse and lookup the delegation account if EIP7702 is enabled.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
2025-12-20 11:12:33 +05:30
wit liu
256c76d025
go.mod: use toolchain go v1.25.5 (#1883) 2025-12-19 14:38:47 +04:00
Daniel Liu
0d381ece9f
core/types, internal/ethapi: fixes for prague RPC encoding #30926 (#1839) 2025-12-19 14:38:23 +04:00
Daniel Liu
142b1155d8
all: implement eip-7702 set code tx #30078 (#1759) 2025-12-19 14:09:45 +04:00
Daniel Liu
b08622248c
trie: add error-checks #26914 (#1138) 2025-12-19 11:47:02 +04:00
Daniel Liu
56ef5f3956
trie: reduce unit test time #26918 (#1139) 2025-12-19 11:46:35 +04:00
wit liu
75f147a362
common: simplify FileExist helper #32969 (#1871) 2025-12-19 11:07:32 +04:00
wit liu
b3d12e4fda
common: remove unused variables (#1875) 2025-12-19 10:39:23 +04:00
wit liu
a83c43f240
all: use 0x-prefix string for type Address in log message (#1874) 2025-12-19 08:55:21 +04:00
wit liu
d3b35cba42
rpc: fix a flaky test of the websocket #33002 (#1877) 2025-12-19 08:19:47 +04:00
Daniel Liu
d976cc65d2
core/txpool: fix isGapped implementation #27404 (#1864) 2025-12-18 13:15:50 +04:00
Daniel Liu
503d51945b
core/txpool: disallow future churn by remote txs #26907 (#1860) 2025-12-16 11:05:39 +04:00
Daniel Liu
c9a730d859
core/txpool: use atomic int added in go1.19 #26913 (#1856) 2025-12-16 10:43:09 +04:00
Daniel Liu
999ded17da
all: change chain head markers from block to header #26777 (#1846) 2025-12-16 07:36:51 +04:00
Daniel Liu
cbb0605e0f
core/txpool: used priceList.Put instead of heap.Push #26863 (#1855) 2025-12-16 07:34:47 +04:00
Daniel Liu
ed6f9e82fc
core/txpool: allow future local tx #26930 (#1857) 2025-12-16 07:34:20 +04:00
Daniel Liu
0894fcdb6e
core/txpool: use types.EmptyRootHash instead of null #27230 (#1862) 2025-12-16 07:33:45 +04:00
Daniel Liu
ebbbdf2bff
core/state: move state log mechanism to a separate layer #30569 #30732 (#1775) 2025-12-16 07:33:19 +04:00
Daniel Liu
d9867ea87d
core/txpool: move some validation to outside of mutex #27006 (#1858) 2025-12-15 12:34:23 +04:00
Daniel Liu
322ec7f997
core/txpool : fix map size avoid resizing #27221 (#1861) 2025-12-15 12:33:56 +04:00
Daniel Liu
7f89733a09
eth/tracers, core: handle non-EVM tx tracing, fix #1863 (#1865)
* Detect non-EVM special transactions and construct a synthetic top level callFrame in OnTxStart.
* GetResult returns the virtual frame for non-EVM txs to preserve debug API compatibility.
* Add bounds checks in OnTxEnd and OnLog to avoid panics when callstack is empty.
* Add unit tests to verify the fix
2025-12-15 12:33:32 +04:00
Daniel Liu
12554081cd
core/txpool: implement additional DoS defenses #26648 (#1853) 2025-12-15 12:32:47 +04:00
wit liu
0199e57fcf
internal/ethapi: select precompiles using the simulated header #33363 (#1866) 2025-12-14 13:47:00 +05:30
wit liu
b624614ebc
core/types: use switch improve readability in function IsVotingTransaction (#1868) 2025-12-14 13:21:21 +05:30
wit liu
4b7963e0ae
core/types: use switch improve readability (#1867) 2025-12-12 16:56:25 +05:30
wit liu
07c6262d42
cmd/utils: fix handling of boolean flags when they are set to false #33338 (#1859) 2025-12-12 16:55:21 +05:30
wit liu
69d8d042e6
rlp: finalize listIterator on parse error to prevent non-advancing loops#33245 (#1854) 2025-12-11 16:51:46 +05:30
Daniel Liu
b3935db5f1
rpc: use finalized when marshal BlockNumber (#1848) 2025-12-11 16:40:06 +05:30
Daniel Liu
94d0fceffe
all: use FinalizedBlockNumber instead of CommittedBlockNumber (#1847) 2025-12-11 16:19:51 +05:30
Daniel Liu
6ccbf98292
core/txpool: remove deprecated uses of math.rand #26710 (#1843) 2025-12-11 16:19:20 +05:30
Daniel Liu
d3e994377b
core: assign zero after resize in implementations of heap.Interface #26296 (#1841) 2025-12-11 16:18:55 +05:30
Daniel Liu
d75f2822d3
core/types: use new atomic types in caches #29411 (#1793) 2025-12-11 16:18:37 +05:30
Daniel Liu
d8aac24223
core/txpool: check if initcode size is exceeded #26504 (#1842) 2025-12-11 16:18:18 +05:30
wgr523
a3282d4119
XFN-155: consensus V2 initial timer kick-off check (#1849)
* fix: consensus V2 initial timer kick-off check

* style: use Cmp for big.Int
2025-12-10 09:36:58 +08:00
wgr523
1089f0b4fe
record total minted API v2 (#1769)
* feat: GetTokenSupply API, total minted and burned

* feat: token supply API finish burned token. rename minted record functions

* fix(api): handle edge case about minus 1 for epoch in token supply

* fix: check both total minted and burned before breaking loop

* style: modify minor style

* style: modify by comment and rebase code

* chore: modify test based on statedb_utils
2025-12-09 19:43:19 +08:00
Daniel Liu
c287f9eddd
core/types: support yParity field in JSON transactions #27744 (#1816) 2025-12-09 11:27:37 +05:30
wit liu
62272ed4e6
accounts/usbwallet: fix double hashing in SignTextWithPassphrase #33138 (#1852) 2025-12-09 11:27:13 +05:30
Daniel Liu
5c879a5e05
core: refactored blockchain.go to blockchain_reader.go #23735 (#1844) 2025-12-09 11:02:41 +05:30
Daniel Liu
5634b75866
core/types: add derived chain ID to LegacyTx JSON encoding #27452 (#1792) 2025-12-09 11:02:24 +05:30
Daniel Liu
f363000d2d
core/types: add json marshalling and tweaks #27256 (#1817) 2025-12-09 11:02:05 +05:30
wit liu
20e6a3ef9d
core/vm: refactor memory resize #33056 (#1845) 2025-12-09 11:01:47 +05:30
Daniel Liu
70755237e7
contracts, core/rawdb: refactor read and write randomizeKey (#1806) 2025-12-09 11:01:37 +05:30
wit liu
bf4c48c7c6
cmd: nuke geth bug, nobody is using it anyway #19400 (#1814) 2025-12-08 15:08:46 +05:30
Daniel Liu
bc5794cdf5
core: refactor read and write valid sections (#1808) 2025-12-08 15:07:33 +05:30
Daniel Liu
348b7fa68f
consensus/XDPoS, core/rawdb: stop node if fail to store snapshot (#1803) 2025-12-08 15:07:22 +05:30
wit liu
d6309612fc
all: fix unnecessary whitespace (#1800) 2025-12-08 15:07:11 +05:30
Daniel Liu
28efc50013
build: fix make generate not print changed files (#1820) 2025-12-08 15:06:08 +05:30
Daniel Liu
01b8fce6e3
cmd/utils, internal/flags: deprecate flag XDCx-dbName and XDCx.dbName (#1823) 2025-12-08 15:05:25 +05:30