Commit Graph

2386 Commits

Author SHA1 Message Date
Giulio rebuffo
9ca0a721af
Cumulative index stage (#3314)
* prog

* chain traffic

* added log estimation

* fixed err

* unwind
2022-01-27 10:49:03 +00:00
Alexey Sharp
8bf28dec45 Update skip_analysis and preverified hashes for mainnet 2022-01-27 10:29:47 +00:00
Alex Sharov
6385a35ee8
remove one more logger (#3360) 2022-01-27 13:31:53 +07:00
ledgerwatch
079a177614
[erigon2] Computing data dependencies between transactions (#3290)
* Use ibs per transaction instead of per block

* Remove copy functions, introduce balance increase map

* Fix test

* Fix lint

* Introduce balanceIncrease journal action

* Introduce balanceIncrease journal action

* Simplifications

* Fix

* Reset

* Simplify

* Fix

* Fixes

* Fix for reading nil accounts

* Fix edge cases with reverts

* Clean up test output

* Fix transfers

* Handle special case of ripemd

* Try with fixed compress, only commit every commfreq blocks

* Updates

* Updates

* Update to fixed erigon-lib

* Update to erigon-lib

* Remove stop

* Update to latest erigon-lib

* fixup

* Cleanup

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-01-24 23:12:25 +00:00
Alex Sharov
9e8543d948
Snapshots: fill kv.HeaderNumber table (#3328) 2022-01-24 13:47:05 +07:00
Dmitry Savonin
9c1b5f8f0c
Always set gas bailout to true for Parlia consensus engine due to system transactions gas price (#3330) 2022-01-23 10:32:50 +00:00
Alex Sharov
93e28ed3dd
fix some linter warns (#3310) 2022-01-20 14:00:31 +07:00
Alex Sharov
6fd002eb5a
Snapshot: move old blocks to snapshots (non-async version) (#3309)
* save

* save
2022-01-20 12:01:02 +07:00
ledgerwatch
8287b3eda1
skip analysis and preverified hashes update (#3300)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-01-19 16:24:46 +00:00
Igor Mandrigin
6e01ff5694
fermion: fix block gossip with Starknet txs (#3289)
* move salt to StarknetTransaction

* fixup

* fixup 2

* fixup 2

* fix broken block gossip for with Starknet transactions
2022-01-18 19:54:39 +03:00
Andrew Ashikhmin
f141803661
No need for ApplyBinanceSmartChainEIPs (#3282) 2022-01-18 13:43:21 +00:00
Igor Mandrigin
393753af42
fix starknet tx hashing to work with txpool v2 (#3283)
* fix starknet tx hashing to work with txpool v2

* fix test

* fix starknet txs mining

* lint fixup

* fixup

* fix 2
2022-01-18 11:20:35 +01: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
ledgerwatch
ea6dbd49e8
[erigon2] Running with commitment (#3203)
* [erigon2] Running with commitment

* [erigon2] Running with commitment

* [erigon2] Running with commitment

* go mod tidy

* [erigon2] Running with commitment

* More

* Debug

* fix

* Fix

* state root command

* More fixes

* Fix

* Progress to 164735

* Only trace when failing

* fix for firstInsert

* Over block 1.36m

* Update

* fix to deleteAccount

* Fixes for plainKeys

* Undo printing

* No changeset generation by default

* Print block number on interrupt, fix lint

* Fix lint

* Open history DB as read only

* Print error

* Open non read only

* Readonly again

* Fix lint

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-01-14 16:02:44 +00:00
ledgerwatch
c0db9295b8
Skip analysis and preverified hashe update (#3244)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-01-12 10:36:12 +00:00
primal_concrete_sledge
748abd39f6
Suggesting fix for data race (#3236) 2022-01-11 21:23:24 +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
Andrew Ashikhmin
d14c223881
Simplify miner gas limit post EIP-1559. Default to 30M (#3205) 2022-01-05 16:36:24 +07:00
Alex Sharov
156287a982
Sanity check p2p block (#3197) 2022-01-04 15:46:22 +07:00
Alexandr Borodulin
8203cdf4cd
Added salt to starknet transaction for cairo contract address generation (#3178)
Co-authored-by: Aleksandr Borodulin <a.borodulin@axioma.lv>
2022-01-03 12:32:22 +07:00
Alex Sharov
40205fb7ca
Torrent: continue download after reboot, --torrent.verbosity flag (#3161) 2021-12-24 10:44:14 +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
brendan-kelly
3d048b7f1a
Add chain config and CLI changes for Binance Smart Chain support (#3131)
* Add chain config and CLI changes for Binance Smart Chain support

* Remove BSC hashes for now

* Add an if statement for BSC forks

* Fix up if statement

* Compiles

* Remove extra dependencies from go.mod/go.sum

* Add a TODO

* Potentially fix the tests
2021-12-16 07:26:44 +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
d836e9e2d7
[beta] Skip analysis and preverified hashes (#3130)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-12-14 21:55:47 +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
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
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
Andrew Ashikhmin
d0dbf014f3
Update consensus tests to 10.2. EIP-2681 (#3103)
* ArrowGlacier fork config

* core/vm: implement EIP-2681: Limit account nonce to 2^64-1 (#23853)

This retroactively implements requirements or EIP-2681 for the account nonce upper limit.

* Update consesus tests to 10.2

* Handle TransactionWithHighNonce64Minus1

* Check intrinsic gas in transaction tests

* Refactor overflow protection in IntrinsicGas

* Remove remnants of vm tests

* Update difficulty tests to the new format

Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
2021-12-07 18:24:59 +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
ledgerwatch
494853ae39
Update skip analysis and preverified hashes (#3097)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-12-06 12:40:06 +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
Alex Sharov
178fd1931d
Genesis sync from existing snapshots (#3087) 2021-12-05 09:03:08 +07:00
Giulio rebuffo
3c95db0078
Fixed Proof-of-stake transition (#3075)
* added download channel to stage headers

* added direct execution

* now channel of headers rather than bodies

* simplifications

* fixed ttd headerForward

* garbage removed

* added some more stepping stones

* better transition

* covered edge case

* added names to returned values

* clean
2021-12-03 11:55:00 +01:00
Andrew Ashikhmin
094ab5e77d
[EIP-4399] Remove newly added Header.Random (reuse mixHash instead) (#3069)
* [EIP-4399] Remove newly added Header.Random (reuse mixHash instead)

* add a TODO

* Update mock payload hashes
2021-12-01 13:41:31 +01:00
Giulio rebuffo
d7ee2b1447
Merge pull request #2997 from ledgerwatch/enginev1
Added ExecutePayloadV1 to engine_ namespace [the merge]
2021-11-30 19:21:17 +01:00
TBC Dev
e98f39b2c4
Fix Header.EncodingSize() to match EncodeRLP() with EIP-3675 (#3053)
* Fix Header.EncodingSize() to match EncodeRLP() with EIP-3675

* Fix error messages for Random in DecodeRLP()
2021-11-30 14:23:34 +00:00
ledgerwatch
feebc7d3e6
save (#3059) (#3060)
Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
2021-11-30 12:36:01 +00:00
TBC Dev
5eca3beea9
Avoid redundant BitLen() (#3056)
* Prefer uint256.IsZero() or big.Sign() for 0-testing over BitLen()

* Avoid redundant BitLen()
2021-11-29 22:35:51 +00:00
Giulio Rebuffo
e76bc807bb better api 2021-11-29 15:47:08 +01:00
TBC Dev
ae4819ddad
Prefer Block.NumberU64() over Block.Number.Uint64() (#3051) 2021-11-29 11:32:41 +00:00
Giulio rebuffo
cfed35921c
Merge branch 'devel' into enginev1 2021-11-29 09:57:56 +01:00
TBC Dev
57d641b6f9
Avoid redundant Block.Header() deep-copy (#3050)
* Add separate Block.Nonce() and Block.NonceU64()

* Add Block.Seal()

* Avoid redundant Block.Header() deep-copy

* Add warning comment for Block.Header()
2021-11-29 08:52:36 +00:00
ledgerwatch
c3e361eadb
Update skip analysis and preverified (#3045)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-11-28 12:59:11 +00:00
TBC Dev
2f0758e817
ChainSegment efficiency (#3042)
* De-dup blockHeaders66() and blockHeaders65()

* Simplify loops and EOL detection

* Add ChainSegmentHeader struct and refactor

* Add RawRlpHash() to avoid re-encode for header hash

* Avoid multiple redundant rlpHash()

* Sort headers by height,hash to make dups consecutive

* Flip condition to reduce map lookups

* Remove redundant check

* Use rlp.RawValue rather than []byte to help self-document
2021-11-27 17:28:17 +00:00
Giulio Rebuffo
768617f412 added proper errors 2021-11-24 23:19:40 +01:00
Giulio Rebuffo
435d1d1519 channels implemented 2021-11-24 23:00:00 +01:00