Commit Graph

2145 Commits

Author SHA1 Message Date
Alex Sharov
18c059b789
Makefile submodule dep (#3387) 2022-01-31 14:20:00 +07:00
Giulio rebuffo
9ca0a721af
Cumulative index stage (#3314)
* prog

* chain traffic

* added log estimation

* fixed err

* unwind
2022-01-27 10:49:03 +00:00
Alex Sharov
bb1d19060f
Add downloader to docker-compose (#3348) 2022-01-26 22:26:33 +07:00
Giulio rebuffo
a75c625d3e
Watchtheburn flag for enabling watch the burn stage (#3325)
* now watch-the-burn needs to be enabled

* refine

* ops

* readme.md

* ops
2022-01-25 17:36:21 +00:00
Alex Sharov
9e8543d948
Snapshots: fill kv.HeaderNumber table (#3328) 2022-01-24 13:47:05 +07:00
Alex Sharov
304b40dd0a
Snapshot: prohibit to change cli flags (#3311) 2022-01-22 11:18:24 +07:00
Enrique Jose Avila Asapche
ffedd6ac3f
Enabled proposer by default (#3319) 2022-01-21 22:50:34 +03:00
Somu Bhargava
c620b1e7c9
Add Erigon Import feature for Hive integration purpose (#3298) 2022-01-20 07:34:50 +00:00
Alex Sharov
6fd002eb5a
Snapshot: move old blocks to snapshots (non-async version) (#3309)
* save

* save
2022-01-20 12:01:02 +07:00
Giulio rebuffo
1c7ab5a770
Tests for WatchTheBurn Stage (#3307)
* issuance tests

* test

* more tests

* ops
2022-01-20 10:40:55 +07:00
Alex Sharov
1e3228124a
Move cli root context to erigon-lib (#3294)
* save

* save

* save
2022-01-19 10:49:07 +07:00
Andrew Ashikhmin
f141803661
No need for ApplyBinanceSmartChainEIPs (#3282) 2022-01-18 13:43:21 +00:00
Dmitry Savonin
a49d409457
Full BSC support with validator mode (#3233)
* migrated consensus and chain config files for bsc support

* migrated more files from bsc

* fixed consensus crashing

* updated erigon lib for parlia snapshot prefix

* added staticpeers for bsc

* [+] added system contracts
[*] fixed bug with loading snapshot
[+] enabled gas bailout
[+] added fix to prevent syncing more than 1000 headers (for testing only)
[*] fixed bug with crashing sender recover sometimes

* migrated system contract calls

* [*] fixed bug with returning mutable balance object
[+] migrated lightclient contracts from bsc
[*] fixed parlia consensus config param

* [*] fixed tendermint deps

* [+] added some logs

* [+] enabled bsc forks
[*] fixed syscalls from coinbase
[*] more logging

* Fix call sys contract gas calculation

* [*] fixed executing system transactions

* [*] enabled receipt hash, gas and bloom filter checks

* [-] removed some logging scripts
[*] set header checkpoint to 10 million blocks (for testing forks)

* [*] fixed bug with commiting dirty inter block state state after system transaction execution
[-] removed some extra logs and comments

* [+] added chapel and rialto testnet support

* [*] fixed chapel allocs

* [-] removed 6 mil block limit for headers sync

* Fix hardforks on chapel and other testnets

* [*] fixed header sync issue after merge

* [*] tiny code cleanup

* [-] removed some comments

* [*] increased mdbx map size to 4 TB

* [*] increased max chaindata size to 6 tb

* [*] bring more compatibility with origin erigon and some code cleanup

* [+] added support of validator mode for BSC chain

* [*] enable private key load for bsc, rialto and chapel chains

* [*] fixed running BSC validator node

* Fix the branch list

* [*] tiny fixes for linter

* [*] formatted imports for core and parlia packages

* [*] fixed import rules in other files

* Revert "[*] formatted imports for core and parlia packages"

This reverts commit c764b58b34fedc2b14d69458583ba0dad114f227.

* [*] changed import rules in more packages

* [*] fixed type mismatch in hack command

* [*] fixed crash on new epoch, enabled bootstrap flags

* [*] fixed linter errors

* [*] fixed missing err check for syscalls

* [*] now BSC implementation is fully compatible with erigon original sources

* Revert "Add chain config and CLI changes for Binance Smart Chain support (#3131)"

This reverts commit 3d048b7f1a.

* Revert "Add Parlia consensus engine for Binance Smart Chain support (#3086)"

This reverts commit ee99f17fbe.

* [*] fixed several issues after merge

* [*] fixed integration compilation

* Revert "Fix the branch list"

This reverts commit 8150ca57e5f2707a84a9f6a1c5b809b7cc84547b.

* [-] removed receipt repair migration

* [*] fixed parlia fork numbers output

* [*] bring more devel compatibility, fixed bsc address list for access list calculation

* [*] fixed bug with commiting state transition for bad blocks in BSC

* [*] fixed bsc changes apply for integration command and updated config print for parlia

* [*] fixed bug with applying bsc forks for chapel and rialto testnet chains
[*] let's use finalize and assemble for mining to  let consensus know for what it's finalizing block

* Fix compilation errors in hack.go

* Fix lint

* reset changes in erigon-snapshots to devel

* Remove unrelated changes

* Fix embed

* Remove more unrelated changes

* Remove more unrelated changes

* Restore clique and aura miner config

* Refactor interfaces not to use slice pointers

* Refactor parlia functions to return tx and receipt instead of dealing with slices

* Fix for header panic

* Fix lint, restore system contract addresses

* Remove more unrelated changes, unify GatherForks

Co-authored-by: Dmitry Ivanov <convexman18@gmail.com>
Co-authored-by: j75689 <j75689@gmail.com>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-01-14 19:06:35 +00:00
Alex Sharov
bcc88bab15
Revert "increase body download timeout (#3217)" (#3262)
This reverts commit f0f33f1519.
2022-01-14 12:55:24 +00:00
Alex Sharov
b86f883f73
Snapshots: watch the burn stage #3259 2022-01-14 14:55:31 +07:00
Alex Sharov
b22e0e4628
don't interrup stage bodies on first cycle (#3253) 2022-01-13 11:22:53 +00:00
Alex Sharov
f0f33f1519
increase body download timeout (#3217) 2022-01-11 07:41:18 +00:00
Alex Sharov
3ab882026c
issuance stage depends on bodies, not on headers (#3228) 2022-01-10 18:19:32 +07:00
Alex Sharov
576a31736c
stage header tmpdir (#3218) 2022-01-08 14:11:08 +07:00
Andrew Ashikhmin
c2d0f0082a
Report Valid ExecutionStatus only after all stages (#3212)
* Stricter transition check

* EthBackendServer.numberSent was unused

* Take account of PoS blocks in TopSeenHeight

* Report Valid ExecutionStatus only after all stages, not straight in headers

* Print TTD on startup

* No need to check parent.Hash() again

* core: change baseFee into baseFeePerGas in genesis json

* fix typo

Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-01-07 16:54:26 +01:00
Alex Sharov
4ef541f5dc
Snapshots: tx lookup in RPC from snapshots (#3214) 2022-01-07 20:52:38 +07:00
Alex Sharov
13d9e71ac7
Snapshots: txnHash2BlockNum idx (#3213) 2022-01-06 18:22:59 +07:00
Alex Sharov
1b856b5237
Snapshot: mainnet hashes and fixes (#3210) 2022-01-06 11:33:01 +07:00
Andrew Ashikhmin
d14c223881
Simplify miner gas limit post EIP-1559. Default to 30M (#3205) 2022-01-05 16:36:24 +07:00
Giulio rebuffo
195eb9abaa
Added mining for POS (#3187)
* added comunication with channels

* added final mining

* removed trash

* bug fixing

* async calls

* one thread

* tests

* better comments

* no lock

* better placing of skipCycleHack

* removed long timer

* moved transitioned block processing

* better naming

* disabled updates on blocks

* sync.Cond

* 2 sync.Cond

* better locking

* Use single sync.Cond. Proposer shutdown

Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
2022-01-04 18:37:36 +01:00
Alex Sharov
156287a982
Sanity check p2p block (#3197) 2022-01-04 15:46:22 +07:00
Alex Sharov
6904e4c3c4
Snapshot: describe idx schema (#3191) 2021-12-31 20:42:56 +07:00
Giulio rebuffo
864b744ed2
Support for syncing on mergemock (#3174)
* block proposing

* standard finalized

* mergemock execution

* private chain can now be ran yay

* perfectioned

* polished

* more polishing

* resize PR

* resize PR

* resize PR

* simplifications

* fixed tests

* better syncronous communication

* better syncronous once again

* clean

* Re-enabled headers verification

* mining finish

* mining finish

* cleaned hash computation

* fixed evm bug

* go.mod

* Update .gitignore

* Update .gitignore

* Update .gitignore

* removed new line from .gitignore

* added go.mod and go.sum

* feeRecipient into preset

* useExternal

* todo

* fixed comment for forkchoiceUpdateV1

* smaller

* smaller

* Revert changes to miner frequency

* Restore useExternalTx

* Fix headerLoadFunc

* do not reset payloadId

* rename

* extra is empty

Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
2021-12-29 17:25:13 +01:00
Andrew Ashikhmin
7ec4843af0
Tests for incremental intermediate hashes (#3172)
* Incremental trie test

* TestStorageDeletion
2021-12-27 08:08:31 +01:00
Alex Sharov
cc5332a351
fix nil pointer in senders stage (#3170) 2021-12-26 14:44:11 +07:00
Alex Sharov
f3973afee8
Rule guard linter enable (#3168) 2021-12-26 10:54:26 +07:00
Andrew Ashikhmin
445ac05220
Verify PoS headers before inserting them into DB (#3151)
* Remove TotalDifficulty stage

* Introduce FeedHeaderFuncType

* Some TODOs

* Don't gossip PoS headers

* FeedHeaderPoS

* Call header.Hash once

* Use FeedHeaderPoS for to write PoS header

* Support errors in EngineExecutePayloadV1

* useExternalTx boilerplate

* Call VerifyHeader on PoS header

* latestValidHash must be nil when status is SYNCING

* fixCanonicalChain instead of canonicalHeadersCollector

* engine.VerifyHeader + FeedHeaderPoS as headerLoadFunc

* fix daemon

Co-authored-by: Giulio Rebuffo <giulio.rebuffo@gmail.com>
2021-12-23 15:06:10 +01:00
TBC Dev
1dbcaa69cc
Move transition logic out of FeedHeaderFunc (#3158)
* Add type alias for FeedHeaderFunc

* Move transition logic out of FeedHeaderFunc
2021-12-23 12:46:55 +01:00
Andrew Ashikhmin
cfb35633ad
Make waitingPosHeaders atomic since it's accessed concurrently (#3157) 2021-12-22 17:12:35 +01:00
Alex Sharov
7390db7b84
Snapshots hashes for mainnet (#3150) 2021-12-21 21:12:32 +07:00
alex.sharov
59c2e88fec Revert "count in .seg"
This reverts commit 1a130bc9a9.
2021-12-17 09:36:07 +07:00
alex.sharov
1a130bc9a9 count in .seg 2021-12-17 09:35:49 +07:00
Giulio rebuffo
c596bb4306
Added WatchTheBurnStage + erigon_watchTheBurn json rpc call (#3137)
* added blockIssuance type

* added stage

* bug fixing

* simplifications

* minimalised

* fixed burned computation

* stage complete

* stage issuance

* reposition

* finished

* lint
2021-12-16 22:08:27 +00:00
Frojdi Dymylja
499c27d2e1
change: port js tracer changes (#3128)
* change: expose callCtx as ScopeContext

* change: update tracer API

* change: logger API
update: jst tracer

* add: port jst tracer 2

* add: port jst tracer 3

* add: access list tracer

* chore: lint
2021-12-15 13:19:58 +00:00
ledgerwatch
bcdff3cb9b
Txpool tracing by sender addresses (#3113)
* Txpool tracing by sender addresses

* Update to latest erigon-lib

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-12-14 16:15:54 +00:00
Alex Sharov
ecb10e8548
Snapshots download and seed (#3117)
* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* Squashed 'interfaces/' content from commit e5b1945d0

git-subtree-dir: interfaces
git-subtree-split: e5b1945d02da7a7f00e2289034ee90a6edd60184

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save
2021-12-14 10:13:17 +00:00
Andrew Ashikhmin
d739810dc5
Serenity engine: fall back to eth1 engine before the Merge (#3112)
* (EIP-4399) MixDigest is utilized for RANDOM

* Add GetTd to ChainHeaderReader

* Remove unused VerifyHeaders from consensus consensus

* Introduce params.MaxGasLimit

* Serenity engine: fall back to eth1 engine before the Merge

* Serenity engine in CreateConsensusEngine

* ethOne -> eth1Engine
2021-12-13 18:29:38 +01:00
Giulio rebuffo
23b3c1d9bc
Added reversed for proof-of-stake syncing (#3092)
* reverse sync slow but working

* progress

* p

* close request

* backwards refactoring

* cleanup 1

* added RequestAssembler

* remove trash code and spaghetti

* efficient

* fix

* refactor

* tf

* refact

* final refactoring

* headers forward restored

* test fixed

* make CI happy

* resolved comments

* not using insertList anymore

* oops

* better collectors

* removed debug config

* avoid pointers

* added sleep

* use of channels

* sleeping

* added logs for ETL

* added more cleanup

* correct glacier

* some refactoring

* maxRequests

* tweaks

* config.go

* config conflicts

* renamed functions
2021-12-13 17:46:15 +01:00
Alexandr Borodulin
22a9a9b27d
Add error tests for starknet_sendRawTransaction method (#3102)
* Add error tests for starknet_sendRawTransaction method

* Noop tx pool

* Rename cairo tx to starknet tx, refactor starknet send raw transaction test

* Remove noop tx pool

* Transaction struct

Co-authored-by: Aleksandr Borodulin <a.borodulin@axioma.lv>
2021-12-12 22:24:21 +00:00
brendan-kelly
ee99f17fbe
Add Parlia consensus engine for Binance Smart Chain support (#3086)
* Add Parlia consensus engine for Binance Smart Chain support

* Leave RamanujanBlock as nil in params/config.go

* Run `go fmt` on files needing it

* Add comment for PoSA

* Remove empty branches and ineffectual assignments in parlia.go

* Remove commented imports

* Fix compilation error

* Remove EIP155Signer in transaction_signing.go

* Fix compilation issue

* Fix go fmt issues

* Remove Ramanujan from print statement

* Remove references to EthAPIBackend approach

* Fix Finalize method across consensus engines

* Run go fmt

* More linting

* Remove more changes

* remove a comment

* Remove unneeded hashing function

* Remove bytes check and fix actual vs expected mistake
2021-12-11 00:07:10 +00:00
ledgerwatch
5413a4db91
Header download simplifications (#3106)
* Header download simplifications

* Fixes

* Reuse headerRaw for inserting into DB

* Fix tests

* Fix test

* Revert to the loop in RequestMoreHeaders

* Change Warn to Debug

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-12-10 07:04:04 +00:00
Enrique Jose Avila Asapche
c3ed07ca4a
Implementing basic unwind process for Proof-of-stake (#3083)
* initial commmit

* gofmt

* flipped if statement

* flipped if statement (forgot to save)

* passing unwinding to status ch

* added unwinding constant

* took out unwinding

* added statusCh

* added a return statement and a second part to the if statement

* checking for parent hash

* checking for parent hash

* changed check to check for parentHash

* staged wrong file

* changed header check to parentHash check

* channged blockhash name to a better name

* changed it to check for header.Hash()

* changed name of blocknumber to blockHash

* changed bad block to common.Hash{}
2021-12-07 17:36:12 +01:00
Alexandr Borodulin
bbb3cc978f
Starknet getcode (#3038)
* deploy_cairo_smartcontract

* deploy_cairo_smartcontract / 2

Add new transaction type for cairo and vm factory

* starknet_getcode

* deploy_cairo_smartcontract / 3

* deploy_cairo_smartcontract / 4

* deploy_cairo_smartcontract / 5

Co-authored-by: Aleksandr Borodulin <a.borodulin@axioma.lv>
2021-12-06 14:58:53 +00:00
primal_concrete_sledge
d89e5d2603
Issue/2710 add grpc health check (#3091)
* ISSUE-2710: Add standard grpc health check to services with grpc server

* Go import changed files

* Add flags for healthcheck

* Add grpc healthcheck option to rpcdaemon

* Remove grpc port info if grpc is not enabled

* Resolve merge issues
2021-12-06 12:03:46 +00:00
Andrew Ashikhmin
759fb00593
[beta] Stricter uint256 RLP decoding. Update consensus tests to 10.1 (#3089)
* Clean up test runners. Don't run legacy tests

* Cherry pick https://github.com/ethereum/go-ethereum/pull/22927

* Tests update 10.1: Transaction Tests

* Port decodeBigInt changes to decodeUint256

* Introduce (*Stream) Uint256Bytes

* Temporarily disable stTransactionTest/HighGasPrice

* linter

* ttWrongRLP transaction tests pass now

* Fix stTransactionTest/HighGasPrice

Co-authored-by: Felix Lange <fjl@twurst.com>
2021-12-06 08:00:54 +00:00