Commit graph

81 commits

Author SHA1 Message Date
Daniel Liu
001bd7ef3b
fix(eth/hooks,contracts): use parent-state randomize data for checkpoint validator verification (#2186)
Read randomize values at the checkpoint parent height during v1 HookValidator and HookVerifyMNs instead of the latest chain state. This fixes a sync-time race where historical checkpoint headers could be rejected with ErrInvalidCheckpointValidators and then accepted later after local state advanced.

The accompanying regression test now derives expected validators independently from HookValidator and the M2 generation path uses a local RNG source, removing CI-only nondeterminism during repeated verification.
2026-03-21 15:26:54 +08:00
Daniel Liu
8d93eb6e3d
fix(contracts): use pool nonce for imported block sign tx (#2213)
Use pool pending nonce when creating the imported-block sign transaction.

Previously the code used state nonce, which could lag behind pool nonce when a pending tx with the same sender already existed. In that case, adding the new sign tx could hit replacement checks and fail with 'replacement transaction underpriced'.

This change switches nonce selection to PoolNonce to avoid nonce reuse in the local pool and prevent repeated sign insertion failures after block import.
2026-03-19 14:26:58 +08:00
Daniel Liu
13548d5d9e
refactor(core/txpool): remove locals-tracking from pools #30559 (#2176) 2026-03-17 12:24:20 +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
b3d354a897
all: move main transaction pool into a subpool #27463 (#1890) 2026-01-05 15:43:50 +05:30
wit liu
a83c43f240
all: use 0x-prefix string for type Address in log message (#1874) 2025-12-19 08:55:21 +04:00
Daniel Liu
70755237e7
contracts, core/rawdb: refactor read and write randomizeKey (#1806) 2025-12-09 11:01:37 +05:30
wit liu
66e96b507c
all: use 0x-prefix for Address type in log (#1830) 2025-12-07 15:36:36 +05:30
Daniel Liu
6235de71ba
all: rework statedb utils (#1785) 2025-11-18 11:26:28 +05:30
Daniel Liu
eef5242fa3
all: pre-allocate memory for slices and maps, close XFN-148 (#1714) 2025-11-14 20:13:36 +05:30
Daniel Liu
c7fb2e875d
consensus, contracts: check input length of ExtractValidatorsFromBytes, close XFN-14 (#1608) 2025-10-08 13:16:01 +08:00
wit liu
e9da4ca95b
all: fix ineffassign (#1516)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:49:28 +08:00
wit765
12eab8e785
all: rename ChainId to ChainID #16853 (#1456)
Co-authored-by: wit <wit765765346@gmail>
2025-09-09 22:54:34 +08:00
Daniel Liu
06b2524fb2
all: use fmt.Appendf instead of fmt.Sprintf where possible #31301 (#1432) 2025-09-06 17:12:19 +08:00
benjamin202410
3e43756fd7
fix: add TIP condition for reward bug fix (#1360)
Co-authored-by: liam.lai <liam.lai@us>
2025-08-20 01:25:44 -07:00
benjamin202410
3cea40cf9d
fix: owner and foundation same address for reward (#1024)
Co-authored-by: liam.lai <liam.lai@us>
2025-05-01 08:46:09 -07:00
JukLee0ira
653b59710e core/rawdb: separate raw database access to own package (#16666 #19345) 2025-01-22 15:19:39 +08:00
Daniel Liu
82ff8c19a0 all: remove uses of untyped golang-lru 2024-12-21 14:39:26 +08:00
Daniel Liu
8b2e8d9b3a all: refactor txpool into it's own package in prep for 4844 (#26038) 2024-11-01 11:36:53 +08:00
Daniel Liu
5132d7f7e0 contracts: fix staticcheck warning S1025: unnecessary fmt.Sprintf("%s", x) 2024-10-31 21:48:23 +08:00
Daniel Liu
c36642a0e1 all: fix staticcheck warning ST1008: error should be last return value 2024-10-31 09:51:47 +08:00
Daniel Liu
a5bc0baba9 all: fix staticcheck warning ST1019: import package twice 2024-10-28 17:45:19 +08:00
Daniel Liu
5bc578f4bc contracts: log Signer reward from Info to Debug 2024-08-21 15:16:38 +08:00
JukLee0ira
0aab4ced98 common: add binary variables for system contract 2024-06-06 19:33:59 +08:00
Daniel Liu
6338a4195b core: kill off managed state, use own tiny noncer for txpool (#19810) 2024-05-10 19:48:10 +08:00
Liam
e55fca6703
log improvement and some refactor (#110) 2022-07-10 01:11:28 +02:00
wgr523
89acbdd742
XIN-121 Reward hook (#57)
* v2 Hook Reward, need test

* test reward

* fix RewardHook due to modifying params config directly (#56)

* more test

* finish test

Co-authored-by: Jerome <wjrjerome@gmail.com>
2022-02-19 15:31:19 +11:00
Jerome
f8d3f9f8c6
Xin 113 is epoch switch (#37)
* add isEpochSwitch function and refactor utils

* fix broken first v2 epoch switch block

* use adaptor epoch switch function to determine v1 v2 epoch swtich block

* add test for the GetMasternodesByNumber and GetCurrentEpochSwitchBlock function

* add v2 test for isAuthroisedAddress

* Use GetCurrentEpochSwitchBlock in findNearestSignedBlock api
2022-01-14 21:38:38 +11:00
wgr523
5c326961ce
isEpochSwitch, getMasternodes (#35)
* isEpochSwitch, getMasternodes

* recursive getEpochSwitchInfo, getMasternodes

* more log, make getEpochSwitchInfo clearer
2022-01-08 00:17:21 +08:00
Jianrong
e34311ff45 Remove unused consensus v1 methods 2021-10-10 16:04:34 +11:00
Jianrong
0aec2a1e9e Seperate hooks from XDPoS adaptor 2021-10-10 16:02:19 +11:00
Jianrong
fcbc5a28e1 refactor XDPoS to accommodate multiple consensus engine versions 2021-10-10 16:02:16 +11:00
olumuyiwadad
b5abbfed79 new EVM Upgrade
- Solidity Upgraded up to v0.8.0
-  Fixed and Added eth_chainId
- Fix error in TransactionRecipet
- Reward halving issue fixed
2021-09-21 16:53:46 +05:30
olumuyiwadad
a41658640f hotfix etherbase/coinbase
Send tx sign for block number to smart contract blockSigner.
2021-09-17 18:18:55 +05:30
olumuyiwadad
571c41f891 FIx Bad block error. 2021-09-17 17:59:06 +05:30
dev-vadim
dbe8c9d984 upgrade XDC.Network with v1.8.27. 2020-12-23 16:32:06 +05:30
diglspacedavid
474cc37036 upgrade codebase with ethereum:v1.8.13 2020-11-23 13:40:30 +05:30
parmarrushabh
3e5f4d54a8 Hot_Fix Bad block Error 2019-04-25 12:11:30 +05:30
AnilChinchawale
a638d2adc0 Minor error fixed. 2019-03-16 16:02:10 +05:30
AnilChinchawale
d8a786fc7a fixed utils contract 2019-03-06 15:53:30 +05:30
parmarrushabh
c6886f92f2 removed kyc smart contract for stable version 2019-03-05 15:44:26 +05:30
parmarrushabh
147e1f0baf create new func penalties for hard fork 2019-02-19 17:25:31 +05:30
AnilChinchawale
e62fd0abe4 Fixed and updated blocksignerReader 2019-01-12 08:34:50 +05:30
AnilChinchawale
4624bbb988 updated utils.go 2018-11-24 16:23:43 +05:30
AnilChinchawale
ba8e4f46bf crit when get voters, voter capacity 2018-11-22 12:33:27 +05:30
MestryOmkar
4ab49f2752 goroutine get signers 2018-11-19 12:20:40 +05:30
AnilChinchawale
e8336d2770 evm mem db 2018-11-19 12:11:07 +05:30
parmarrushabh
51c88fe8ce create new api get reward 2018-11-19 11:21:42 +05:30
Rahulraj04
6c67be797b update logging 2018-11-17 16:37:14 +05:30
parmarrushabh
ae06c120a7 Fixed reward only for masternodes in block checkpoint. 2018-11-14 17:08:41 +05:30