Commit Graph

173 Commits

Author SHA1 Message Date
Alex Sharov
3e8a028cbb
evm: remove interpreter interface - step3 (#8842) 2023-11-29 09:29:16 +07:00
Andrew Ashikhmin
ee942473d9
Replace eip1559FeeCollector with burntContract (#8553)
burntContract, introduced in PR #8504, is more generic than
eip1559FeeCollector
2023-10-22 16:23:40 +02:00
a
436493350e
Sentinel refactor (#8296)
1. changes sentinel to use an http-like interface

2. moves hexutil, crypto/blake2b, metrics packages to erigon-lib
2023-10-22 01:17:18 +02:00
Anshal Shukla
7dce1268ab
Agra HF (#8504)
Adds agra HF to the bor consensus
2023-10-21 01:16:19 +05:30
Andrew Ashikhmin
b60642fa5a
Configure EIP-4844 parameters for Gnosis (#8464)
See https://github.com/gnosischain/specs/pull/20 &
https://github.com/gnosischain/specs/pull/24
2023-10-13 11:43:16 +02:00
Alex Sharov
c293883ec0
evm: no interface (#8376)
after removal of tevm experiment - we left interfaces everywhere 
removing it for performance and for geth compatibility
2023-10-05 12:23:08 +07:00
Andrew Ashikhmin
94ec54e7a5
Implement EIP-7516: BLOBBASEFEE opcode (#8231)
[EIP-7516](https://eips.ethereum.org/EIPS/eip-7516) is part of
[devnet-9](https://notes.ethereum.org/@ethpandaops/dencun-devnet-9)
2023-09-19 10:45:19 +02:00
Andrew Ashikhmin
03ac80ad2d
EIP-4844: rename "data hash" to "blob hash" (#7947)
See https://github.com/ethereum/EIPs/pull/7001
2023-07-31 10:12:53 +02:00
Andrew Ashikhmin
7d35c6b737
EIP-4844: Rename "data gas" to "blob gas" (#7937)
See https://github.com/ethereum/EIPs/pull/7354 &
https://github.com/ethereum/consensus-specs/pull/3461. Prerequisite:
https://github.com/ledgerwatch/erigon-lib/pull/1058
2023-07-28 12:12:05 +02:00
Andrew Ashikhmin
a24eae8d6c
EIP-4844: Handle data gas in txpool (#7779)
Prerequisite: https://github.com/ledgerwatch/erigon-lib/pull/1029
2023-06-23 11:10:23 +02:00
Alex Sharov
e5023775aa
Enforce blockReader interface (#7737)
- breaks dependency from staged_sync to package with block_reader
implementation
- breaks dependency from snap_sync to package with block_reader
implementation
- breaks dependency from mining to txpool implementation
2023-06-15 13:11:51 +07:00
Andrew Ashikhmin
190bc9dfd8
EIP-4844: add data_gas_used (#7639)
Implement https://github.com/ethereum/EIPs/pull/7062 and
https://github.com/ethereum/EIPs/pull/7095. Pick up
https://github.com/ledgerwatch/erigon-lib/pull/1006.
2023-06-02 21:26:19 +01:00
racytech
65efc92af3
eip-4844: vm and engine_api extensions, minor fixes/changes (#7514) 2023-05-19 18:43:04 +01:00
racytech
36e70c545b
eip-4844: data gas fees & related check (#7449)
Logic to compute fees for data blobs as well as additional check that
verifies if user was willing to pay the current `data_gas` price.
Updated `FakeExponential` function to work with uint256.
2023-05-08 12:20:10 +07:00
Andrew Ashikhmin
1533674dad
Implement EIP-1153 transient storage (#7405)
Port https://github.com/ethereum/go-ethereum/pull/26003

---------

Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
2023-05-01 18:26:24 +02:00
racytech
6588bca40b
eip-4844: NewMessage now expectes maxFeePerDataGas & GetPayloadV3 impl (#7365)
types.NewMessage now expects maxFeePerDataGas param, which will be used
in transaction verification (preCheck). GetPayloadV3 method added to
EngineAPI. Some cosmetic changes applied.
2023-04-23 18:27:05 +01:00
racytech
ef71909c34
eip-4844: extensions to compute fees for data blobs (#7328)
Small additions that will be used to compute data blob fees and to
verify transactions for "willingness" to pay for these fees.
2023-04-21 11:07:54 +01:00
Andrew Ashikhmin
96bb5d544b
Remove Parlia (#7306)
Pre-requisite: https://github.com/ledgerwatch/erigon-lib/pull/969
2023-04-14 06:24:10 +00:00
Andrew Ashikhmin
d12fda5cbd
Switch AccessList, IntrinsicGas, SafeAdd/Mul to erigon-lib (#6709)
Reduce code duplication.
2023-01-26 12:26:12 +01:00
hexoscott
7dcbfbc283
reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
ledgerwatch
3999c46046
Native tracers - step 1 (#6356)
In this first step, the new functions `CaptureTxStart` and
`CaptureTxEnd` are introduced to all tracers

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-18 04:36:57 +00:00
Alex Sharov
16cd87748f
E3: fix unwind changes visibility (#6147) 2022-11-30 08:31:13 +07:00
Andrew Ashikhmin
03057c4e61
Update consensus tests to v11.2 (#6111)
[v11.2](https://github.com/ethereum/tests/releases/tag/v11.2) includes,
among other things, tests for
[EIP-3860](https://eips.ethereum.org/EIPS/eip-3860): Limit and meter
initcode.
2022-11-22 16:07:31 +01:00
Andrew Ashikhmin
9ffc457cbb
EIP-3860: Limit and meter initcode (#5892)
[EIP-3860](https://eips.ethereum.org/EIPS/eip-3860) is
[included](https://github.com/ethereum/execution-specs/pull/633) into
[Shanghai](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md).

TODO: similar changes to `txpool`.

Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
2022-10-31 13:40:41 +01:00
Andrew Ashikhmin
6a5968e7f0
AuRa service transactions are free (#5873)
and the don't pay baseFee after EIP-1559.

See https://openethereum.github.io/Permissioning.html#gas-price
2022-10-26 13:03:47 +02:00
Andrew Ashikhmin
da354bc01a
Unify Bor burntContract with Gnosis eip1559FeeCollector (#5798) 2022-10-21 13:03:38 +02:00
Andrew Ashikhmin
241348c5d4
core: implement EIP-3651, warm coinbase (#5745)
[EIP-3651](https://eips.ethereum.org/EIPS/eip-3651) is part of
[Shanghai](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md).

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2022-10-14 14:00:00 +02:00
Levi Aul
7144b2664c
Support BSC Nano hardfork (#5654) 2022-10-07 07:20:48 +01:00
Andrew Ashikhmin
7e0f6e0864
Small logging improvements (#5217)
* More logging to debug invalid blocks

* typo

* More logging consistency

* Print mismatched receipt hash

* Fix logging

* Improve log consistency

* Don't ignore errors in txn.Sender

* Log txn sender as well

* Log txn receipt as well

* Revert log level to debug
2022-08-29 15:26:36 +02:00
Alex Sharov
351cd49c21
go1.19 gofmt (#4988) 2022-08-10 19:04:13 +07:00
sudeep
7f81e0ddde
in transaction execution, subtract from account balance only after enough gaspool is ensured (#4450)
- noticed the difference when executing testdata#10 in go-ethereum and erigon
2022-06-14 20:33:30 +01:00
Andrew Ashikhmin
21ca6b6790
Update consensus tests to 10.4 (#4287)
* Update consensus tests to 10.4

* Introduce CheckEip1559TxGasFeeCap
2022-05-30 14:56:07 +02:00
Enrique Jose Avila Asapche
58851feb9b
Fix eth call (#3618)
* added isFake

* using isFake instead of checkNonce

* Revert "using isFake instead of checkNonce"

This reverts commit 6a202bbcdda666677fc93744549046432fae18b6.

* Revert "added isFake"

This reverts commit 2c4802488afde25ac583c6af6e6778cfa90c4dcd.

* only checking EOA if we are checking for Nonce
2022-02-25 12:51:29 +00:00
ledgerwatch
17b2a9ba93
Bor fixes (#3553)
* Integration to work with bor

* Turn off validator set check

* disable verifySeal, add skeleton of postExec stage

* Pass around syscall

* Print

* Print more

* Default heimdall values for integration

* restore contract

* Print

* Print

* Print

* Print

* Print

* Print

* Print

* Print

* Fix nonce of system contract

* Remove prints

* Revert some more printing

* More fixes

* Print log

* Fix transfer log

* More printing

* More printing

* Print

* Print

* Print

* Print

* Print

* Print

* Print

* Fix validaor reward

* Remove printing

* Remove more prints

* Less printing

* Fetch validators from heimdall

* Remove syscall from Seal and CalcDifficulty

* Remove syscall from Prepare

* Print

* Remove DNS discovery

* Print apply snapshot

* Print

* Chunk up snapshot generation

* Chunk up snapshot generation

* Better logs when snapshotting

* Handle parents

* Prevent shadowing of snap

* Fix heimdall fetch

* Logging fixes

* Save generated snapshots

* Add header

* Less logging

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-02-24 00:03:10 +00:00
ledgerwatch
78974d7844
Fix for BSC incorrect execution (#3560)
* Fix for BSC incorrect execution

* collect skip analysis

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-02-21 12:42:23 +00:00
Enrique Jose Avila Asapche
35fcd3a829
Merging Turbo bor into devel (#3372)
* implemented bor consensus

* add bor flags to default

* change bucket into snapshot to clique

* enable stateSync

* bypass reciept checks

* fix receipt calculation and bor logs

* fix: contract call wrt bor

* Update mumbai config

* Add: bor-mainnet flag and config

* Add bor consensus to integration

* use header coinbase in block context

* london fork mumbai changes

* fix genesis error

* Jaipur fork for mumbai

* add sysCall to verifyHeader

* added bor related rpc method implementation

* added bor specific rpc extensions

* fixes in snapshot implementation, major refactor for bor rpc

* modify consensus specific db path for bor

* fix: remove parallel compute for get root hash rpc method

* Added bor-receipt flow

* Use turbo-bor-lib and bor tables

* Use bor table in RPC snapshot

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* update rpc readme

* link rpc docs in readme

* Update Readme

* Update Readme

* move erigon namespace rpc methods to eth

* rm: erigon namespace

* rm: erigon namespace, update list of available rpc methods, add example

* fix: binary name in rpc readme

* fix: max db size

* Add london to bor-mainnet

* updated node.go

* add system req to readme

* golang version fix readme

* added networknames in correct place

* nil

* ran gofmt

* erigon

* fixed fake.go

* dont need turbor-lib

* old readme

* fixing readme

* half

* other half

* changed return

* fixing return

* fixed return

* fixed flags

* gofmt

* merge with devel

* latest erigon-lib

* fixed context.coinbase

* took out syscall

* fixed params in hash

* bor type now is consensus.Engine

* parlia is consensus.Engine

* missing arg and repeated importation

* repeated importation

* fixed eth_receipts.go

* deleted duplicate issuance

* part of consensus.Engine type

* added eth_api issuance

* networkname

* added erigon_system file

* fork struct taken out

* added erigon block

* getLogByHash for erigonImpl

* gofmt

* fixed lint

* ops

* gofmt

* gofmt

* added APIImple functions

* fixed clique test

* took out print

* fixed state added balance

* fixed README

* fixed rpcDaemon README

* fixed integration README

* updated blockchain.go

* lint

* added bor back into blockchain.go

* took out comment

* lint

* updated daemon

* updated wtb

* removed duplicate

* removed VerifyHeaders

* prevent use of wrong Transfer

* fixed state_processor.go

* fixed state_transition.go

* fixed headers

* returning err

* error handling in bor read tx look up

* put for txLookUp

* dealing with error

* lint

* traces

* more traces

* fixed receipt in execution

* getTrasanction receipt for bor or others

* nil

* lint

* ops

* deleted syscall

* took out else

* Merge branch 'devel

* tests syscalls

* changed borReceipt to receipt

* reset header algos

* arguments fix

* took out prefixes

* lint

* erigon-named

* borReceiptKey = blocknumber

* reverts e3b60c2e159d03efcb855f7ab3da5a098dd60c33.

* correct hashing tx

* dont need it here

* lint

* added txlookup for bor

* change to uint256

* outputs for isBor

* wrapper

* added isBor and isParlia

* isBor

* fixed BorTransfer

* not readBody

* correct prefix

* added blockNum

* added readStorageBody

* readStorageBody

* lint

* got rid of unnecessary bor_receipt func

* onlny if bor

* use clone

* append

* writeToSlice

* added isBor flag

* fixed writeToSlice

* normal sorting

* lint

* Reset erigon-snapshots

* Move bor prefix into if

Co-authored-by: Krishna Upadhyaya <krishnau1604@gmail.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Uttam Singh <uttamkhanduja@yahoo.in>
Co-authored-by: Giulio Rebuffo <giulio.rebuffo@gmail.com>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-02-07 21:30:46 +00: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
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
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
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
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
Andrew Ashikhmin
91df893e84
EIP-3607 (check if sender is EOA). Update tests to v10.0 (#2820)
* Update Ethereum tests to v10.0

* Implement EIP-3607
2021-10-13 08:30:09 +07:00
ledgerwatch
44f43312c9
Minor fixes for tracing (#2485)
* Minor fixes for tracing

* Typo in comment

* rpctest bench tracefilter to use limited number of accounts

* replay command to fail if there is a difference

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-08-03 20:58:18 +01:00
Alex Sharov
733991018b
port active precompiles activation (#2448) 2021-07-27 09:39:41 +07:00
Andrew Ashikhmin
db86092ccd
Remove unnecessary value transfer check from TransitionDb (#2424) 2021-07-26 15:09:39 +01:00
ledgerwatch
026c4e9d02
Reorg ropsten solution (#2419)
* Reorg ropsten solution

* Add option

* Print TD recalc

* Correct fix for eip1559

* Try to fix the unwind

* Print header progress and hash

* Not insert descendants of bad headers

* Print some more

* Print less

* Better way of marking bad headers

* Disable inSync

* Penalise peers who give incorrect chain pieces

* better fix for initial cycle

* Clean up

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-07-22 16:49:36 +01:00
ledgerwatch
96ee6e1537
Fix for eip1559 incorrect assert (#2415)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2021-07-21 19:35:08 +01:00
Alex Sharov
29695bc91d
Revert "Revert "buy gas optimize (#2360)" (#2367)" (#2369) 2021-07-14 21:34:14 +07:00
Alex Sharov
ede11f1ab1
Revert "buy gas optimize (#2360)" (#2367)
This reverts commit 7c95f3911f.
2021-07-14 21:10:48 +07:00