Commit graph

121 commits

Author SHA1 Message Date
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
wit liu
39eb15531d
all: fix whitespace error of golangci-lint, remove extra empty lines (#1676) 2025-11-17 11:16:09 +05:30
Daniel Liu
3efe26df08
all: refactor so NewBlock, WithBody take types.Body #29482 (#1605) 2025-10-08 13:12:35 +08:00
wit liu
1b88f2588e
eth/fetcher: fix copyloopvar for Go 1.22+ (#1505)
Co-authored-by: wit <wit765765346@gmail>
2025-09-17 08:21:23 +08:00
Daniel Liu
34020969ff
all: simplify timestamps to uint64 #19372 (#1318) 2025-08-08 10:33:37 +08:00
Daniel Liu
5e8a096844
eth/fetcher, trie: unit test reliability fixes #23020 #23415 (#1070)
Some tests take quite some time during exit, which I think causes
some appveyor fails like this:

    https://ci.appveyor.com/project/ethereum/go-ethereum/builds/39511210/job/xhom84eg2e4uulq3

One of the things that seem to take time during exit is waiting
(up to 100ms) for the syncbloom to close. This PR changes it to use
a channel, instead of looping with a 100ms wait.

This also includes some unrelated changes improving the reliability of
eth/fetcher tests, which fail a lot because they are time-dependent.

Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-06-17 13:21:18 +08:00
Daniel Liu
e8c9fdde0f
eth/downloader: refactor downloader + queue #21263 (#1041)
* eth/downloader: refactor downloader + queue

downloader, fetcher: throttle-metrics, fetcher filter improvements, standalone resultcache

downloader: more accurate deliverytime calculation, less mem overhead in state requests

downloader/queue: increase underlying buffer of results, new throttle mechanism

eth/downloader: updates to tests

eth/downloader: fix up some review concerns

eth/downloader/queue: minor fixes

eth/downloader: minor fixes after review call

eth/downloader: testcases for queue.go

eth/downloader: minor change, don't set progress unless progress...

eth/downloader: fix flaw which prevented useless peers from being dropped

eth/downloader: try to fix tests

eth/downloader: verify non-deliveries against advertised remote head

eth/downloader: fix flaw with checking closed-status causing hang

eth/downloader: hashing avoidance

eth/downloader: review concerns + simplify resultcache and queue

eth/downloader: add back some locks, address review concerns

downloader/queue: fix remaining lock flaw

* eth/downloader: nitpick fixes

* eth/downloader: remove the *2*3/4 throttling threshold dance

* eth/downloader: print correct throttle threshold in stats

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2025-06-17 13:01:06 +08:00
Daniel Liu
5b8c267122 trie: use trie.NewStackTrie instead of new(trie.Trie) (#22246) 2025-04-07 16:44:32 +08:00
Daniel Liu
a9b9f53701 core, eth, trie: add a prefix to contract code (21080) 2025-03-24 22:31:03 +08:00
Daniel Liu
ebb2c3b2ea all: new empty trie with types.EmptyRootHash instead of null (#27230) 2025-02-07 13:04:45 +08:00
Daniel Liu
002fac8b14 all: remove the duplicate 'the' in annotations (#17509) 2025-01-24 16:18:28 +08: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
edce9ccb27 all: fix staticcheck warning S1024: not use x.Sub(time.Now()) 2024-10-31 10:49:44 +08:00
wanwiset25
cb792ef34f Revert EIP-2464 2024-08-24 02:31:27 +07:00
wanwiset25
4be4f2eeb1 fix tests 2024-06-28 18:35:47 +04:00
wanwiset25
57b11ab4c9 try use insertblock in fetcher 2024-06-28 11:33:04 +04:00
wanwiset25
c9ee3240fb fix tests 2024-06-28 11:33:04 +04:00
wanwiset25
1b781530c6 add xdpos protocol test cases 2024-06-28 11:33:04 +04:00
Martin Holst Swende
8f4a269437 eth, les: add sanity checks for unbounded block fields (#19573)
This PR adds some hardening in the lower levels of the protocol stack, to bail early on invalid data. Primarily, attacks that this PR protects against are on the "annoyance"-level, which would otherwise write a couple of megabytes of data into the log output, which is a bit resource intensive.
2024-06-28 11:33:04 +04:00
Péter Szilágyi
93b2a23216 core, eth: announce based transaction propagation (#20234) 2024-06-28 11:33:04 +04:00
Daniel Liu
ec50ca36d9 core, eth, trie: use common/prque (#17508) 2024-05-09 18:38:27 +08:00
Liam
e55fca6703
log improvement and some refactor (#110) 2022-07-10 01:11:28 +02:00
Liam
ac5096d692
upgrade log level and log message (#102) 2022-06-19 10:59:09 +02:00
Liam
ca6a645fca
refactor and improve log (#92)
* refactor and improve log

* fix conflict and test
2022-05-23 02:34:32 +01:00
wgr523
8fde52c512
Xin 145 (#82)
* add HandleProposedBlock() in procFutureBlocks()

* add proposedBlockHandler for downloader
2022-04-22 00:12:44 +08:00
Liam
3ac908be8d
xin-104 (#36)
* hand and vote self mined block

* add error log
2022-01-08 10:56:00 +11:00
Liam
6c5fe34615 v2 miner function implementation and happy path (#22)
* New struct in consensus/XDPoS/utils/types.go, util functions, and test. (#14)

* define vote, timeout, sync info, qc, tc, extra fields in types.go, add test in types_test.go

* add json tag in types.go, refine encoder decoder of extra fields

* refactor types.go utils.go

* re-write types, comments

* add Hash SigHash for types, and tests

* define Round type

* remove unnecessary logs

* add v2 engine functions placeholder

* typo fix on the consensus v2 function placeholders

* add countdown timer

* make initilised private to countdown

* add v2 specific config struct

* rename some config variables

* Implement BFT Message receiver (#13)

* fix or skip tests due to PR-136 changes

* add bft receiver functions

* add bft receiver functions

* rename tc to TimeoutCert

* implement more functions

* New struct in consensus/XDPoS/utils/types.go, util functions, and test. (#14)

* define vote, timeout, sync info, qc, tc, extra fields in types.go, add test in types_test.go

* add json tag in types.go, refine encoder decoder of extra fields

* refactor types.go utils.go

* re-write types, comments

* add Hash SigHash for types, and tests

* define Round type

* remove unnecessary logs

* add temp functions

* add v2 engine functions placeholder

* typo fix on the consensus v2 function placeholders

* add countdown timer

* make initilised private to countdown

* push verify function

* add test on receiving vote

* revert type change

* add async on broadcast function

* add quit initial

* fix test

Co-authored-by: Jianrong <wjrjerome@gmail.com>
Co-authored-by: wgr523 <wgr523@gmail.com>

* generate and verify timeout message

* Consensus V2 variable, timeout pool (#19)

* fill in XDPoS_v2 variables and processQC/TC

* add timeout pool, refine engine variables

* refactor type functions

* solve a small pointer bug

* create general pool and its test, refine engine

* refine pool, add xdpos v2 config cert threshold

* refine config

* vote and timeout handlers

* fix pool test

* bft miner preparation

* review comment improvement

* update

* relocate tests

* add and remove comment

* fix the syntax error

* update network layer and add handler functions (#23)

* update network layer and add handler functions

* fix test syntax error

* add ProcessQC implementation

* add ProcessQC tests

* add snapshot test

* add wait qc process

* remove testing files

* add route snapshot

* fix merge issue

* add default v2 behaviour (#24)

* add v2 ecrecover functions and refactor test

* fix all the tests

* put minimun lock variable

* debugging prepare and seal v2 blocks

* Trigger proposeBlockHandler after v2 block received and verified in fetcher

* skip snapshot apply related tests

* update test check

* rename bfter to bft handler and ignore normal behviour

* fix bugs during local 4 node run

* fix test

* fix sync info test

* fix bugs during local 4 node run

* rebase and fix bug

* remove hook validators function"

Co-authored-by: wgr523 <wgr523@gmail.com>
Co-authored-by: Jianrong <wjrjerome@gmail.com>
2021-12-30 11:45:18 +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
571c41f891 FIx Bad block error. 2021-09-17 17:59:06 +05:30
Jianrong
0fdab2027c add linting as the first CI task 2021-08-07 14:27:08 +10:00
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
8d7572ef1c hot fix 2018-11-22 15:49:29 +05:30
parmarrushabh
9f36d37558 Parallel process block from fetcher 2018-11-17 12:02:43 +05:30
parmarrushabh
52ae30023a refactor RW & pairRW connect for block , transaction 2018-11-14 10:40:05 +05:30
MestryOmkar
bbadba469b change difficulty block in XDPoS 2018-11-12 15:52:55 +05:30
parmarrushabh
176b51f1f8 ignore faster with block no validator m2 2018-11-12 15:41:24 +05:30
MestryOmkar
5111364215 fix error double validation : m2 not validate body before verify block 2018-11-12 12:39:52 +05:30
MestryOmkar
de7c60ed49 sleep time when fetch receive future block 2018-11-12 11:45:26 +05:30
parmarrushabh
3268d372a0 fix error fatal error: concurrent map read and map write 2018-11-12 11:39:43 +05:30
parmarrushabh
3fc36efeb3 Fixed golint. 2018-11-09 10:49:11 +05:30
MestryOmkar
01a3ec9a47 tiny fix m2 duplicate sign block 2018-11-09 18:07:01 +05:30
MestryOmkar
1175d8e1b1 fix dv m2 validate block detail before broadcast 2018-11-09 16:53:09 +05:30
AnilChinchwale
53e39d77ac fix error double validation 2018-11-09 16:42:45 +05:30
parmarrushabh
1396b1a10f Fixed unit test for new m2 block header. 2018-11-09 16:29:54 +05:30
MestryOmkar
07b4be1284 Add new block header validator for store m2 data. 2018-11-09 16:11:13 +05:30
MestryOmkar
89d931299f correct order - dv before importing 2018-11-09 14:46:03 +05:30
MestryOmkar
b955291388 init double validation layer 2018-11-06 18:00:21 +05:30
parmarrushabh
76153eea4a Fixed bug calculate reward and add unit test for it. 2018-09-22 10:12:05 +05:30