go-ethereum/core
Arpit Temani b48b89f852
all: implement milestones (#961)
* Milestone Implementation

* Merge branch 'POS-347' into reciept-e2e-test

* Changes for testing, will be removed after testing

* Debugged the error

* Just for testing purpose

* refactor debug api methods, rename whitelist -> checkpoint

* remove first iteration based vars

* fix linters

* Rewind Changes

* Error changes

* RewindBack function in bor_checkpoint_verifier

* Testcases

* Added the fetch test for milestone and checkpoint

* Debugged the lint changes

* Debugged the lint changes

* Debugged the lint changes

* Debugged the lint changes

* Improved the error in Miner test file

* Improved the error of pointing to the wrong function

* Locking the sprint after the vote has been made on it.

* Adding more logs for testing

* Adding more logs for testing

* Adding more logs for testing

* Implemented the NoAckMilestone fetching mechanism

* Testcases for milestone implementation

* Testing code  for fetchNoAckMilestone and fetchLastNoAckMilestone

* Testing changes

* refactor else-if

* Corrected the number of params in bor_ext.go

* Dummy API for testing

* Defined the GetVoteOnRootHash in interface

* Defined the GetVoteOnRootHash in interface

* Made changes in the web3ext file

* Added the GetVoteOnRootHash in PublicBlockChain API

* Added the GetVoteOnRootHash in filterBackend

* Added the log of Root and RooHash

* Removed the 0x from rootHash

* Just for testing purpose

* "GetVoteOnRootHash" mock implementation

* bor_test.go

* Added the test for milestone implementation

* Added service for fetching milestone by ID

* Improved the comments

* Removed the duplicate code

* use setter for borVerifier

* use setter for borVerifier

* refactor handleNoAckMilestone

* remove code repetition with retry function

* Converged the repetitive code

* after CR

* persistence

* persistence implementation

* feature flag

* Persistence Changes

* cr

* initial

* fix

* fix

* Whitelist Flag

* 1 Add:Included the milestone flag  2.Add:Hardlimit the rewind to maximum of 255 blocks

* Chg:Updated go.mod file

* Remove:Dubai Hardfork code

* Add:checked errors for call functions to the Db, Rmv: Remote Header variable from the IsValidPeer() function

* Fix:Linting issues'

* Add:MilestoneGRPC functions

* Fix:Lint issues

* Fix:Lint issues

* Fix: TestFetchMilestoneFromMockHeimdall

* Fix:Integrations tests

* Add:Test for sprint length and milestone changes

* Add:Functionality to fetch the finalized block

* Chg:Changed default val of TriesInmemory to 1024

* fix:Some functions of heimdallGRPC client

* Restored the GRPC functionality, was commented out for  developing purpose

* Fix:Bor_checkpoint_Verfier function

* Test:Added the chain Rewinding test

* Test:Added the Sprint Length + Milestone merge test

* Add:Implemented the future milestone

* Add:Future milestone changes

* Add:Future milestone changes

* Chg: Voting on endBlockHash rather than rootHash

* Chg: Changed the logic of future milestone from rootHash checking to endBlockHash checking

* Fix:Using endBockHash while verifying the incoming milestone

* Chg:Variable names for better readiblity

* Fix:Testing changes

* Add:metrics for milestone implementation

* Add:Metrics for milestone implementatian

* Fix:Order of statements in a function for better optimization

* Chg:Removed unrequired file

* Fix:new variable intialization

* Add:Comment to increase readiblity

* Fix:Logs

* Chg:Name of GetVoteOnRootHash to GetVoteOnHash

* Fix:Linting issues

* Fixed linting issues

* Rmv: Unnecessary logs and Add:Skip test for long tests

* Fix:Checking current chain with whitelisted milestone or checkpoint in Finalized block function

* Fix:Test

* Fix:Whitelisting of Milestone and Checkpoint process

* Fix: Milestone JSON structure

* Chg:Testcases changes

* Fix:Change from VoteOnRootHash to VoteOnHash

* Fix:Variable name fix

* Fix:Finalized API

* internal/jsre/deps: update web3.js bundle

* Fix:milestone verifier

* Chg:Handling the long future chain import issue

* Fix:Lint issues

* Fix:TestLowDiffLongChain and TestPrunedImportSide tests, used hardcoded value 128 instead of DefaultTriesInMemory value

* Chg:Testcode for producing metrics

* Chg:Milestong polling value to 32 secs

* Add:Testcases

* Add:Implemented the check to fetch the milestoneId from heimdall before locking the fork

* Added GRPC method for FetchMilestoneID

* Fix:lint issue

* Fix:lint issue

* Skiped out the tests which were mainly used to produce the supporting data

* remove vcs build when running snyk

* Add:Improved the logs and comments

* fix linters

* Skipped some test as they are panic due to timeout issue in github

* Chg:Variable name LockerSprintNumber to LockedMilestoneNumber for better readablity and clarity

* Chg:Conflicting variable names in milestone test file

* Chg:Conflicting function names in milestone test file

* fix : minor fix in TestInsertingSpanSizeBlocks

* Fix:Mocking issue in TestInsertingSpanSizeBlocks

* Fix:GRPC Polyproto Version

* eth/downloader: skip peer drop due to whitelisting err

* eth, tests/bor: bug fixes and minor refactor

* Add:Implemented the milestone related functions in the HeimdallApp

* Fix:Lint Errors & Remove:Redundant Code

* Fix:Testing Errors

* Fix:Bor integeration tests

* Fix:Test errors

* update heimdall client mock files

* remove unused arguments

* remove redundant code

* Chg:Changed the milestone polling intervals

* Add: added block finality from whitelisted checkpoint

* skip future chain validation

* Add:confirmation check of 16 blocks over the end block while voting for the milestone in GetVoteHash() function

* Chg:Included endBlockNum in UnlockMutex function

* Add:Property based test for milestone

* Fix:Opening the lock while processing future milestone

* Add:Property based test for futureMilestone

* Defined the value of TempTriesInMemory

* Fixed the finalized api

* Fixed lint issues

* eth: add logs while fetching and rewinding

* fix linters: use default returns instead of recursive calls

* Fix:Milestone intergration test

* Add:GetVoteHash fn in mock backend

* tests/bor: fix mock span

* tests/bor: remove t.Parallel()

* use bor namespace in ethclient, fix mock function

---------

Co-authored-by: Vaibhav Jindal <vaibhavjindal29@gmail.com>
Co-authored-by: VaibhavJindal <74560896+VAIBHAVJINDAL3012@users.noreply.github.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Evgeny Danienko <6655321@bk.ru>
Co-authored-by: Shivam Sharma <shivam691999@gmail.com>
Co-authored-by: Anshal Shukla <shukla.anshal85@gmail.com>
2023-08-28 18:42:21 +05:30
..
allocs fix typo 2021-09-23 10:56:17 +05:30
asm dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
beacon dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
blockstm Merge branch 'develop' into mardizzone/upstream-merge 2023-07-24 14:19:30 +05:30
bloombits dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
forkid dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
rawdb all: implement milestones (#961) 2023-08-28 18:42:21 +05:30
state fix : lint 2023-07-24 14:44:50 +05:30
tests dev: fix: all remaining lint issues 2023-06-19 11:39:59 +02:00
txpool core/txpool: convert lock acquire log to debug 2023-08-24 11:42:05 +05:30
types fix : TxDependency 2023-07-28 18:02:53 +05:30
vm dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
.gitignore Renamed chain => core 2014-12-04 10:28:02 +01:00
bench_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
block_validator.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
block_validator_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
blockchain.go all: implement milestones (#961) 2023-08-28 18:42:21 +05:30
blockchain_bor_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
blockchain_insert.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
blockchain_reader.go all: implement milestones (#961) 2023-08-28 18:42:21 +05:30
blockchain_test.go all: implement milestones (#961) 2023-08-28 18:42:21 +05:30
blocks.go use go-ethereum for better forked-bor release 2020-11-13 09:21:48 +05:30
bloom_indexer.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
bor_blockchain.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
bor_events.go fixes 2021-12-06 14:25:33 +05:30
bor_fee_log.go fix : TestGraphQLConcurrentResolvers 2023-07-18 18:15:06 +05:30
chain_indexer.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
chain_indexer_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
chain_makers.go fix : testcase : config, addTxWithChain, burnAmount 2023-06-26 14:07:31 +05:30
chain_makers_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
dao_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
error.go Merge qa to develop (#814) 2023-04-10 16:21:18 +05:30
events.go Minor Refactor 2021-12-03 17:28:53 +05:30
evm.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
forkchoice.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
forkchoice_test.go all: implement milestones (#961) 2023-08-28 18:42:21 +05:30
gaspool.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
gen_genesis.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
gen_genesis_account.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
genesis.go fix : test-integration 2023-07-17 16:39:12 +08:00
genesis_alloc.go all: remove support for Ropsten (#26644) 2023-02-09 10:03:00 +02:00
genesis_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
headerchain.go dev: fix: all remaining lint issues 2023-06-19 11:39:59 +02:00
headerchain_test.go dev: fix: all remaining lint issues 2023-06-19 11:39:59 +02:00
mkalloc.go build: upgrade to go 1.19 (#25726) 2022-09-10 13:25:40 +02:00
parallel_state_processor.go fix : TxDependency 2023-07-28 18:02:53 +05:30
rlp_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
sender_cacher.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
state_prefetcher.go dev: fix: all remaining lint issues 2023-06-19 11:39:59 +02:00
state_processor.go core: restore AddFeeTransferLog post miner tipping 2023-07-18 13:52:36 +05:30
state_processor_test.go fix : freezer, TestStateProcessorErrors 2023-07-03 17:11:56 +05:30
state_transition.go core,eth/tracers: fix TestPrestateWithDiffModeTracer 2023-07-06 15:51:52 +05:30
types.go dev: add: merge develop in upstream-merge 2023-06-13 12:37:20 +02:00