Commit graph

306 commits

Author SHA1 Message Date
Evgeny Danilenko
3c94dfb25f
A thread safe way to take a free port (#485)
* initial commit

* safe latest error

* remove json listener

* fix: debug block unit test

* remove jsonrpc listener from server

* fix: consume network's find port in heimdall client test

* update key in log while startup

* linters

* fix

Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
2022-08-16 18:43:18 +03:00
Krishna Upadhyaya
72aa44efe6
Fix EOF error in gRPC state-sync (#489)
* Fix EOF error in gRPC state-sync

* linters

Co-authored-by: Evgeny Danienko <6655321@bk.ru>
2022-08-11 20:40:08 +03:00
Evgeny Danilenko
e699254142
Use atomic pointer in go 1.19 (#446)
* use atomic pointer

* golang version

* golang version

* go1.19

* linters

* Bump golangci-lint

* linters

* linters

* linters after merge

* generic logger

* generic logger

* logger

* logger

* linters

* bump toml

* linters1

* linters

* linters

* linter

* linter

* linters

* linters

* linters
2022-08-09 22:11:09 +03:00
Krishna Upadhyaya
fb17cdaf38 Merge branch 'develop' into POS-648 2022-07-28 19:33:11 +05:30
Krishna Upadhyaya
0c0fb63491 Implemented retry middleware in heimdall gRPC 2022-07-28 18:11:59 +05:30
Manav Darji
6e8428bfaa
consensus/ethhash: skip TestRemoteMultiNotifyFull in sealer test (#470)
* skip test in sealer test for ethhash consensus

* add a todo and test skip reason
2022-07-27 22:29:07 +05:30
Krishna Upadhyaya
75bb3bdeb1 Merge branch 'develop' into POS-648 2022-07-27 19:09:04 +05:30
Krishna Upadhyaya
f55f816351 fixed context in gRPC code 2022-07-27 19:07:48 +05:30
Krishna Upadhyaya
00c2b3329c fix lint 2022-07-26 18:15:21 +05:30
Krishna Upadhyaya
8de8a6815c Integrated heimdall gRPC server flow 2022-07-26 18:08:25 +05:30
Krishna Upadhyaya
dbbacb8b19 Using polyproto v0.0.2 and removed type utils 2022-07-26 11:16:11 +05:30
Krishna Upadhyaya
385aff85f0 Implemented heimdall gRPC client 2022-07-26 02:18:37 +05:30
Jerry
c50ff82ab1 Fix "Signer 0x... is not a part of the producer set at block xxxx"
The validator set json loaded from database will have an empty map. This change will recompute the validator map based on validator set.
2022-07-25 10:19:39 -07:00
Manav Darji
bf60c6ce06
consensus/bor: add mock heimdall rest-server, tests for timeout and cancellation (#458)
* add: mock heimdall rest-server, tests for timeout and cancellation

* fix: use mux for route handling
2022-07-19 16:22:41 +05:30
Manav Darji
c44693706a
RFC35/Common Ancestor: Modifying the forkchoice rule (#425)
* initial

* update

* fix: add validator to NewBlockchain function calls

* handle past chain reorg

* fix: only check with last checkpoint

* rm logs

* add: handle future chain import case

* fix: handle single block case

* add unit tests for past and future chain

* modularise forker tests

* minor fixes

* add: overlapping chain test case, minor fixes

* minor fixes

* add: isolated unit test for IsValidChain

* add more test case for IsValidChain

* fix: use index for header time

* add: fetch last N checkpoints in first run

* fix: change checkpoint count to int64

* fix: handle edge case

* fix: handle no checkpoint case separately

* fix: consider offset for future chain calculation

* re-write test case for split chain

* fix: typo

* add: split chain properties test

* separate reorg checks, validate chain before inserting

* fix: handle err incase of invalid chain

* fix: use error from whitelist service

* split chain property tests

* remove duplicate test cases

* cleanup

* clean up

* fix linters

* fix: fetch checkpoint count bug, add tests

* fix more linters

* fix: handle nil chain validator in downloader

* fix: mock bor tests

Co-authored-by: Evgeny Danienko <6655321@bk.ru>
2022-07-15 10:37:35 +05:30
Arpit Temani
7b25997830
Reciept e2e test (#431)
* initial

* fixed tests

* eip155 tests

* progress

* fix

* fix TestFetchStateSyncEvents*

* debug

* fixed with updated list of validators

* fix

* a bit more stable

* optimize allocations

* linters

* fix vals copy

* a bit of refactoring

* update TestGetTransactionReceiptsByBlock

* remove logs from TestGetTransactionReceiptsByBlock in favour of checks

* comments

* Linters

* linters

* fixes after merge

* fixes after merge

* fixes after merge

* fixes after merge

* fail fast

Co-authored-by: Evgeny Danienko <6655321@bk.ru>
2022-07-14 19:28:56 +03:00
SHIVAM SHARMA
1147994c65
Added valSet testcases (#452)
* Added valSet testcases

* Added Negative Assertions

* Minor Changes

* Added varying valset length

* Minor changes

* Linting
2022-07-13 12:21:29 +03:00
Evgeny Danilenko
3c42bfc633
add context to Fetch* methods (#445)
* add context

* fix mocks

* fixes after CR

* fixes

* fix

* Linters
2022-07-13 09:07:32 +03:00
Jerry
9ec673870a Set Heimdall client to nil when 'withoutheimdall' is set 2022-06-16 10:28:28 -07:00
Evgeny Danilenko
342bf3089e
Merge develop branch into v0.3.0-dev (#430)
* merge geth v1.10.15

* fix: Removed FastSync from cli server

* fix: TestHeadersRLPStorage

* Added t.skip(ETH2 in bor)

* fix: flow in create consensus engine

* bumped version

* Fix typo

* increase block time

* remove file

* bumped version

* merge gethv1.10.17

* bumped version

* fix failing tests

* Bump Go version to v1.18 (#368)

* Bump Go version to v1.18.1

* Build using netgo tag

This will create a static build using Go native networking stack.

Checked and it works stable for all archs and distros.

* Fix meta

* initial implementation for common ancestor approach

* extract whitelist interface

* fix types

* fix tests and format

* add unit tests for IsValidChain function

* more tests

* wip

* test ErrCheckpointMismatch

* minor fixes

* fix test

* dont panic

* fmt

* Limit state sync by gas

* Added logging for state-sync total gas usage

* Added number of event-records in log

* Minor Changes

* Minor Fix

* Adding individual gasUsed

* Minor Fix

* fix: return value for no remote block

* handle all errors

* modularise fake chain validator in downloader

* add more tests

* fix tests

* Modifying miner.recommit flag and its adjustment function. (#370)

* changed min/max/current recommit values

* Remove Hardcoded min/max

* Code Sanitization

* Skipping tests for constant recommit interval

* Adding default miner.recommit value

* Minor Change

* Increased default value of rpc.txfeecap to 5

* add debug rpc endpoints for checkpoint whitelist service

* minor fixes and enhancements

* avoid capping warnings for gas set by internal system transactions

* use typed mocks

* fix

* fix

* fix

* fix close

* fix

* Create stale.yml

* Fix bor consensus checkpoint bug

Co-authored-by: Arpit Temani <temaniarpit27@gmail.com>
Co-authored-by: Shivam Sharma <shivam691999@gmail.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Sandeep Sreenath <sandeep.sreenath@gmail.com>
Co-authored-by: Victor Castell <victor@victorcastell.com>
Co-authored-by: Ferran <ferranbt@protonmail.com>
Co-authored-by: Krishna Upadhyaya <krishnau1604@gmail.com>
Co-authored-by: Karlo <karlonovak@gmail.com>
Co-authored-by: Sandeep Sreenath <ssandeep@users.noreply.github.com>
Co-authored-by: Jerry <jerrycgh@gmail.com>
2022-06-15 09:02:01 +03:00
Evgeny Danilenko
9c8bf51f57
Prepare Bor package for testing (#416)
* Limit state sync by gas

* Added logging for state-sync total gas usage

* Added number of event-records in log

* Minor Changes

* Minor Fix

* Adding individual gasUsed

* Minor Fix

* it works

* fix tests

* log wiggle and delay with block number

* log delays as numbers

* linters

* fix tests

* restore linters for the project

* fix linters

* fix

* fix

* fix

* linters

* generation

* fix tests

* remove heimdall wrapper response

* linters

* remove possible collisions

* remove possible collisions

* remove possible collisions

* tests for unique address generation

* generalize set

* bor miner tests got restored

* fixes after CR

* final step and mining test

* fix

* fix e2e

* more tests for Heimdall requests

* fix linters

Co-authored-by: Ferran <ferranbt@protonmail.com>
Co-authored-by: Shivam Sharma <shivam691999@gmail.com>
2022-06-08 16:39:30 +03:00
Jerry
5092006b27 Fix default Dockerfile for new CLI 2022-05-27 14:40:04 -07:00
Jerry
2e2557a2d0 Enable prealloc check and improve address comparison 2022-05-26 11:55:44 -07:00
Jerry
12ab0f0240 Lint consensus/bor module
Cleanup, lint, and enable linters for consenssus/bor module.

Disabled linter "gomnd" and "tagliatelle" because they are not
easy to fix and the return on the time investment is very low.
Disabled linter "prealloc" because it is not easy to guess and pre-allocate the
slice accurately in many cases.
2022-05-23 19:46:59 -07:00
Evgeny Danilenko
87a2e5224f
Merge pull request #395 from maticnetwork/testing-flags
Restores linters and separate kinds of tests
2022-05-23 19:42:18 +03:00
Evgeny Danienko
95bfcdc5f4 macos tests 2022-05-13 10:06:11 +03:00
Manav Darji
be01489883 move logs 2022-05-10 17:03:08 +02:00
Manav Darji
e4e5d4a0c1 fix: fetch span retry bug 2022-05-10 17:02:57 +02:00
Shivam Sharma
c3d180cc46 Minor fix 2022-05-09 17:08:03 +02:00
Shivam Sharma
b172ba8fbf Sorted Difficulties 2022-05-09 17:08:03 +02:00
Shivam Sharma
e0b43b0116 Minor fix 2022-05-09 17:08:03 +02:00
Shivam Sharma
e496afb98c Minor Fix 2022-05-09 17:08:03 +02:00
Shivam Sharma
4e6d323382 Added GetSnapshotProposerSequence 2022-05-09 17:08:03 +02:00
Arpit Temani
2321e64ed7
V0.2.16 candidate (#373)
* merge geth v1.10.15

* fix: Removed FastSync from cli server

* fix: TestHeadersRLPStorage

* Added t.skip(ETH2 in bor)

* fix: flow in create consensus engine

* bumped version

* Fix typo

* increase block time

* remove file

* bumped version

* merge gethv1.10.17

* bumped version

* fix failing tests

* Bump Go version to v1.18 (#368)

* Bump Go version to v1.18.1

* Build using netgo tag

This will create a static build using Go native networking stack.

Checked and it works stable for all archs and distros.

* Fix meta

* Bump version

* Meta as stable

Co-authored-by: Shivam Sharma <shivam691999@gmail.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Sandeep Sreenath <sandeep.sreenath@gmail.com>
Co-authored-by: Victor Castell <victor@victorcastell.com>
2022-05-06 12:31:48 +02:00
Jaynti Kanani
44603dbaa9
Update rest.go (#349)
Co-authored-by: Krishna Upadhyaya <krishnau1604@gmail.com>
2022-04-20 15:55:08 +05:30
Manav Darji
8e3d66c5e4
Handle graceful shutdown in bor (#359)
* handle graceful shutdown in bor rest client

* fix: log

Co-authored-by: Jaynti Kanani <jdkanani@gmail.com>

* add: handle shutdown using close channel

* fix: create err variable for shutdown

* use ticker instead of time.After for handling retry

Co-authored-by: Jaynti Kanani <jdkanani@gmail.com>
2022-04-11 10:22:56 +05:30
Arpit Temani
a10f79dc27 jaipur fork (#269)
* jaipur fork

* add check

* review comments

* test case

* fix few changes

* Change condition

* review comments

* type conversion

* Update mumbai.go

* Update config.go

* Update config.go

Co-authored-by: Ferran Borreguero <ferranbt@protonmail.com>
2022-01-11 12:23:28 +01:00
Arpit Temani
7115b84b7a london fork (#260)
* london fork changes

* Update version.go

* burn contract address
2022-01-11 12:22:03 +01:00
Arpit Temani
39116e6cc9
V0.2.12 candidate (#261)
* Fix ancient receipts

* bumped version to 0.2.11

* Genesis change fix (#252)

* read from genesis file

* add: set code in finalize and assemble

* new: storing data in bor config

* chg: remove unwanted code

* chg: refactor

* minor change

* add error states

* Fix small things

* Add test

* Add more coverage in genesis finalize test

* Ensure balance is not changed

* Add decode safe check

* Change bor config block alloc field name

* Remove block alloc values in blocks

* Add genesis alloc code change info logging

Co-authored-by: Ferran Borreguero <ferranbt@protonmail.com>

* add block alloc

* change block alloc

* remove byte array

* mainnet upgrade

Co-authored-by: Ferran Borreguero <ferranbt@protonmail.com>
Co-authored-by: Sandeep Sreenath <sandeep.sreenath@gmail.com>
Co-authored-by: Jaynti Kanani <jdkanani@gmail.com>
2021-12-07 15:28:31 +01:00
Sandeep Sreenath
983e32baf2 merged geth v1.10.10 2021-11-22 19:04:07 +05:30
Martin Holst Swende
6289137827
consensus/clique, core: API cleanup (#23100)
This removes some code:

- The clique engine calculated the snapshot twice when verifying headers/blocks.

- The method GetBlockHashesFromHash in Header/Block/Lightchain was only used by tests. It
  is now removed from the API.
  
- The method GetTdByHash internally looked up the number before calling GetTd(hash, num).
  In many cases, callers already had the number, and used this method just because it has a
  shorter name. I have removed the method to make the API surface smaller.
2021-10-11 23:16:46 +02:00
Marius van der Wijden
53b1420ede
params: changed CatalystBlock to TerminalTotalDifficulty (#23700)
* params: changed CatalystBlock to TerminalTotalDifficulty

* eth/catalyst: comment out unused code
2021-10-11 18:58:11 +03:00
Arpit Temani
b27dca6bbf merge v1.10.7 2021-08-19 15:56:13 +05:30
baptiste-b-pegasys
523866c2cc
all: change blacklist terms 2021-07-29 11:17:40 +03:00
@edgararout
0730acc5a0
consensus/ethash: less allocation during mining (#23199) 2021-07-28 14:24:41 +02:00
Marius van der Wijden
b9e6e43722
consensus/clique: implement getSigner API method (#22987)
* clique: implement getSignerForBlock

* consensus/clique: use blockNrOrHash in getSignerForBlock

* consensus/clique: implement getSigner

* consensus/clique: fixed rlp decoding

* consensus/clique: use Author instead of getSigner

* consensus/clique: nit nit nit

* consensus/clique: nit nit nit
2021-07-13 14:40:22 +03:00
Sina Mahmoodi
5441a8fa47
all: remove noop vm config flags (#23111)
* all: rm external interpreter and ewasm config

* core/vm: rm Interpreter interface

* cmd/geth: deprecate interpreter config fields
2021-07-06 22:03:09 +02:00
Edgar Aroutiounian
5ecec087ef GetPendingStateProposals not called 2021-07-05 12:31:53 -04:00
ucwong
a182c76815
consensus/clique: avoid a copy in clique (#23149)
* consensus/clique:optimize to avoid a copy in clique

* consensus/clique: test for sealhash

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-07-02 09:18:50 +02:00
Péter Szilágyi
7a7abe3de8
accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#23038)
* accounts/abi/bind: fix bounded contracts and sim backend for 1559

* accounts/abi/bind, ethclient: don't rely on chain config for gas prices

* all: enable London for all internal tests

* les: get receipt type info in les tests

* les: fix weird test

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-06-15 13:56:14 +03:00