Commit graph

63 commits

Author SHA1 Message Date
Daniel Liu
4acd3b05ee
XDPoS/utils: use strconv.ParseInt to convert int64, close XFN-24 (#1660) 2025-11-03 12:55:37 +05:30
Daniel Liu
7614a0ad9a
consensus/XDPoS: convert variables to const, close XFN-123 (#1688) 2025-11-03 12:46:35 +05:30
Daniel Liu
9d85990309
all: fix missing nil check, close XFN-114 (#1695) 2025-11-01 23:21:44 +05:30
Wanwiset Peerapatanapokin
e0c987f45a
impose size limit for DecodeBytesExtraFields (#1637) 2025-10-16 12:16:14 +04:00
wanwiset25
998153ebb1 optmize CompareSignersLists 2025-10-12 21:59:55 +04:00
Daniel Liu
c7fb2e875d
consensus, contracts: check input length of ExtractValidatorsFromBytes, close XFN-14 (#1608) 2025-10-08 13:16:01 +08:00
benjamin202410
db9c3de1dc
add syncinfo pool (#1236)
* add syncinfo message into pool for process later

* add missing file back

---------

Co-authored-by: liam.lai <liam.lai@us>
2025-07-28 01:43:41 -07:00
wanwiset25
11ae49b35d make XDPoS_getBlockInfoByEpochNum work with v1 epoch number 2025-07-15 02:30:23 +07:00
Péter Szilágyi
39e9d8f94d common/prque: generic priority queue (#26290) 2024-12-28 09:06:31 +08:00
Daniel Liu
82ff8c19a0 all: remove uses of untyped golang-lru 2024-12-21 14:39:26 +08:00
Daniel Liu
92fc843683 crypto: switch over to upstream sha3 package (#18390) 2024-12-09 17:48:59 +08:00
benjamin202410
a8560300a4
fix vote test and optimize log (#750)
Co-authored-by: liam.lai <liam.lai@us>
2024-11-29 03:14:25 -08:00
liam.icheng.lai
59a7eb1f9f resolve conflict from master 2024-10-30 16:47:26 -07:00
benjamin202410
118ccd08d5
cherry pick epoch api from dev-upgrade (#699)
* cherry-pick-epoch-api
2024-10-29 01:36:22 -07:00
wgr523
71b9005f34
feat: add api xdpos_getBlockInfoByEpochNum (#674)
* feat: add api xdpos_getBlockInfoByEpochNum

* feat: add cache round2epochBlockInfo

* fix: round2epochBlockInfo contains round now

* feat: binary search in GetBlockByEpochNumber

* fix: change some code back, refine style
2024-10-28 00:14:30 -07:00
Daniel Liu
a79411fa06 all: fix staticcheck warning ST1005: incorrectly formatted error string 2024-10-24 09:48:20 +08:00
benjamin202410
042c02ba8c
add last block number for epoch api (#681)
Co-authored-by: Liam Lai <liam@home>
2024-10-20 23:43:23 -07:00
Liam Lai
22fc7d0710 fix conflict 2024-10-16 22:42:53 -07:00
Liam Lai
b43bb5ed1f api epoch 2024-10-15 19:20:13 -07:00
JukLee0ira
2d89951e5b all: use errrors.New instead of empty fmt.Errorf 2024-06-14 19:19:21 +08:00
Daniel Liu
ec50ca36d9 core, eth, trie: use common/prque (#17508) 2024-05-09 18:38:27 +08:00
Jianrong
6740545358 change the API to be block num based 2023-12-28 15:13:05 +11:00
Jianrong
e28b550a24 Add a new API to help debug when there are missed rounds 2023-12-28 15:13:05 +11:00
Liam Lai
824d7b232f resolve conflict 2023-11-20 23:53:49 +11:00
Liam
c215316744
Make masternode dynamic (#356)
* make masternode dynamic

* fix all the tests

* remove cmt

* fix test again
2023-11-16 23:59:19 +11:00
Daniel Liu
0b06bc3a5d not compare strings in func CompareSignersLists 2023-10-23 22:51:06 +08:00
Liam
45c1518ea1
Devnet fix on ci improvement (#314)
* fix ci

* update pr template
2023-08-21 10:07:00 +10:00
Liam
7b657f0c4e
API: getMasternode and getPoolStatus (#258)
* API: getMasternode and getPoolStatus

* fix test
2023-05-01 23:01:39 +10:00
Liam
c4f9a552e5
Multi config bug fix (#216)
* refactor multi config
remove pool cleaner
correct message and log level
2022-12-17 20:23:46 +08:00
Liam
6ffbd3e141
Xin 259 support multi v2 config (#210)
* update timeout period and waittime

* remove wrong comment

* update config for preparing test
2022-12-06 20:08:56 +08:00
Liam
2b3e059abf
xin-244 re-snyc blocks from v1 to v2 (#186)
* xin-244 re-snyc blocks from v1 to v2

* remove log

* correct log

* constant value

* remove comment
2022-10-04 23:33:13 +08:00
Jerome
c710bd98a5
Xin-200 Vote Equivocation (#111) (#172)
* Xin-200 Vote Equivocation (#111)

* add vote same round detection

add test for vote same round detect

finish process equivocate (not finish report)

* finish vote equivocation report, refactor code (vote -> forensics)

* finish process equivocate and report, and test

* add return err

Co-authored-by: wgr523 <wgr523@gmail.com>
2022-08-13 11:50:56 +05:30
Liam
1cac82825d
xin-176 use local masternode to verify signature (#98)
* use local masternode to verify signature

* refactor verify header
2022-06-05 12:53:50 +02:00
Jerome
455cacc1b7
move XDC consensus types into core (#93) 2022-05-22 11:43:25 +10:00
Jerome
6c48d5be6c
Xin 181 178 (#80)
* add skeleton forensics

* remove duplicated penalty check in verify header
2022-04-10 09:40:32 +10:00
Jerome
0ded664f0c
add highestSelfMinedRound to make sure we mine once per round (#79) 2022-04-03 12:45:25 +10:00
Jerome
cb67e8e26a
Xin 163 (#76)
* clean up the pool old round

* add unit test to cover the vote key format

* add gapNumber to the vote pool key

* fix race condition in pool

* remove verify gap number in vote handler
2022-04-01 14:59:16 +11:00
wgr523
b790b077c9
XIN-164 add GapNumber inside Vote, and tests (#74) 2022-03-25 23:22:24 +08:00
Jerome
d55229677d
verify header including validator (#71)
* verify header including validator

* re-structure v1 v2 tests

* remove unused test function

* add test to check coinbase and validator address matches

* refactor engine v2 to group private functions into same file
2022-03-20 21:14:35 +11:00
Jerome
9bb1a6e1b3
XIN-159, 160 and 161 (#69)
* XIN-159, 160 and 161

* update the bft handler to make sure we don't process dis-qualified messages

* add verify header missing checks and its tests
2022-03-13 22:00:26 +11:00
Jerome
e493ddfd6d
add verifyTC and verifyTimeoutMessage (#63)
* add verifyTC and verifyTimeoutMessage

* remove v2 func from adaptor
2022-03-02 09:17:57 +11:00
Jerome
d773e15ca8
Xin 137 (#62)
* add GapNumber

* fix broken countdown test

* add gapNumber to existing tests
2022-02-28 18:51:42 +11:00
Jerome
97985fda85
move verify QC into verify header, fix broken tests etc (#61) 2022-02-27 10:25:26 +11:00
Jianrong
cddeaf2db1 add v2 verify header 2022-02-19 19:36:32 +11:00
Jerome
7cc2bef2d3
update adaptor for verify headers and fix vote handler to include +1 distance when checking rounds (#48) 2022-01-30 14:26:05 +11:00
Jerome
328d555b9b
Xin 138 (#49)
* check block header after vote pool reached

* refactor test_helper to fix issues with tests randomly failing
2022-01-30 13:00:24 +11:00
Liam
aab040fd55
adjust lock (#39)
* adjust lock

* change error log

* change error log
2022-01-16 13:31:23 +03: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
Liam
35eebabae0 xin-106 add generated message into its pool (#32)
* add debug log and change to contain or add for cache

* add generated message into its pool
2021-12-30 11:45:22 +11:00