Commit graph

11157 commits

Author SHA1 Message Date
Jianrong
2a94cdebe5 XIN-109: Add more proposed block handler tests 2021-12-30 11:45:22 +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
Jianrong
6e13b4d6a2 fix proposed block handler based on review comments 2021-12-30 11:12:21 +11:00
Jianrong
249d2b5b6d implemente proposeblock handler and SyncInfo handler 2021-12-30 11:12:21 +11:00
Liam
17eb4c6c65 add default v2 behaviour (#24) 2021-12-30 11:12:21 +11:00
Jianrong
163ed0fab3 add ProcessQC tests 2021-12-30 11:12:18 +11:00
Jianrong
bd60e1b0cf add ProcessQC implementation 2021-12-30 11:00:20 +11:00
Liam
b9068974f5 update network layer and add handler functions (#23)
* update network layer and add handler functions

* fix test syntax error
2021-12-30 11:00:20 +11:00
Jianrong
17f6e67f58 review comment improvement 2021-12-30 11:00:20 +11:00
Jianrong
98014936c3 fix pool test 2021-12-30 11:00:20 +11:00
Jianrong
a39612e540 vote and timeout handlers 2021-12-30 11:00:20 +11:00
wgr523
d47d9a2a99 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
2021-12-30 11:00:20 +11:00
Jianrong
4addb69561 generate and verify timeout message 2021-12-30 11:00:20 +11:00
Liam
a1b77f3ca8 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>
2021-12-30 11:00:20 +11:00
Jianrong
521b703207 rename some config variables 2021-12-30 11:00:20 +11:00
Jianrong
1d48ed7d06 add v2 specific config struct 2021-12-30 11:00:20 +11:00
Jianrong
bf56a64fe0 make initilised private to countdown 2021-12-30 11:00:20 +11:00
Jianrong
bcb1fea280 add countdown timer 2021-12-30 11:00:20 +11:00
Jianrong
8891cd167b typo fix on the consensus v2 function placeholders 2021-12-30 11:00:20 +11:00
Jianrong
1da080a371 add v2 engine functions placeholder 2021-12-30 11:00:20 +11:00
wgr523
4453a1e257 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
2021-12-30 11:00:20 +11:00
Anil Chinchawale
7808840be0
Merge pull request #149 from XinFinOrg/address_prefix_fix
Fix Invalid address in XDC Console.
2021-12-27 13:01:43 +05:30
Jerome
69cadcc585
Merge pull request #153 from XinFinOrg/fix-block-write-read-race-condition
race condition caused by old eth bug where read before write. We fixi…
2021-12-22 14:47:39 +11:00
Gerui Wang
2969548f68 add warn for reorg 2021-12-21 16:06:16 +08:00
Anil Chinchawale
621555993e
Update version.go 2021-12-21 10:45:43 +04:00
Liam Lai
5061dd9841 add few comments in code 2021-12-21 08:47:23 +03:00
Gerui Wang
db58081b8d refine race condition solution 2021-12-21 10:19:17 +08:00
Jianrong
d901d1df6e race condition caused by old eth bug where read before write. We fixing it by passing down header in the snapshot to avoid touching ETH code. This is just a precaution to avoid undiscovered bugs in XDC as a result of fundmental ETH implementation change 2021-12-21 10:32:55 +11:00
Anil Chinchawale
72fb654a13
Update defaults.go 2021-12-05 11:50:15 +05:30
Anil Chinchawale
079e4e16d5
Fix Invalid address in XDC Console. 2021-12-05 11:47:31 +05:30
Anil Chinchawale
f9fa3a8a07
Merge pull request #145 from XinFinOrg/mainnet_test
missing ValidatorMapping update.
2021-11-16 11:09:20 +05:30
AnilChinchawale
5112dc7564 Set Network Upgrade BlockNumber and Version. 2021-11-15 19:34:07 +05:30
olumuyiwadad
afe58d79fc fix api trace block & Change option pending block. 2021-11-11 18:49:57 +05:30
olumuyiwadad
420a589599 ignoreSignerBlockList added. 2021-11-11 18:48:50 +05:30
olumuyiwadad
18bfb102b4 Update Test for blockchain.go
- TestBlocksHashCacheUpdate
- TestAreTwoBlocksSamePath

	Collection test for BlocksHashCache
	cases
		1. When init new chain
		2. when insertChain
		3. when insertFork
		4. When adding new block by mining
		5. When adding new block by syncing with other nodes
2021-11-08 15:41:13 +05:30
olumuyiwadad
adf071665a update version 1.4.2 2021-11-08 15:01:16 +05:30
olumuyiwadad
70e0496138 fetch data from StateDB instead of Contract. 2021-11-08 14:59:32 +05:30
olumuyiwadad
ff56f5e50f update Voter Delay Withdraw. 2021-11-08 14:58:04 +05:30
olumuyiwadad
1bfafade74 Revert XDCValidator. 2021-11-08 14:57:10 +05:30
olumuyiwadad
abee93984b Mainnet test sync. 2021-11-08 14:55:20 +05:30
olumuyiwadad
cca2a7d213 missing ValidatorMapping added. 2021-11-08 14:54:41 +05:30
olumuyiwadad
ac7b764207
Merge pull request #144 from XinFinOrg/dev-upgrade
fetch dev-upgrade.
2021-11-08 14:52:27 +05:30
olumuyiwadad
cbcd635377
Merge pull request #142 from XinFinOrg/statedb-utils-for-xinfin
make validatorReader.go correct
2021-11-08 14:50:34 +05:30
Gerui Wang
a1e6ae4152 make statedb_utils.go (XDCValidator reader) correct, add statedb utils test 2021-11-03 21:05:25 +08:00
Anil Chinchawale
2869165165
Merge pull request #138 from hash-laboratories-au/hashlab-master
Hashlab master
2021-11-03 16:13:36 +05:30
Jianrong
acc2e411a6 fix or skip tests due to PR-136 change 2021-10-20 20:17:47 +11:00
Jerome
a996c3a1a3
Merge pull request #12 from hash-laboratories-au/adaptor-config-setup-with-tests
Adaptor config setup with tests
2021-10-17 12:57:33 +11:00
Jianrong
ce4e16c7c3 replace c to x in XDPos pakage 2021-10-17 11:37:55 +11:00
Jianrong
e5a9a5ddbc replace consensus int config with string const 2021-10-17 11:31:49 +11:00
Jianrong
0eb2504db3 Add 1 test for adaptor to switch from v1 to v2 2021-10-17 11:20:57 +11:00