Commit Graph

3125 Commits

Author SHA1 Message Date
alex.sharov
9ea90b08c3 fix import cycle in tests 2023-04-19 15:35:02 +07:00
alex.sharov
61deabc561 e4: assert state reader 2023-04-19 10:12:16 +07:00
Alex Sharov
21d66d6c01
e3: state reader constructor in tests (#7338) 2023-04-19 03:10:33 +00:00
Andrew Ashikhmin
cd25c09463
Support AuRaStep & AuRaSeal in genesis JSON (#7331) 2023-04-18 08:43:51 +00:00
Alex Sharov
69a3396433
add flag --db.size.limit (#7325) 2023-04-17 12:48:57 +00:00
ledgerwatch
57f051f04c
Update btcd library version (#7316)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-04-16 09:50:54 +00:00
racytech
7aa217f015
eip-4844: setting header's excess_data_gas, verifiying eip-4844 headers (#7308)
In this PR Header's ExcessDataGas is set to the actual value, but it's
still unused. It will be used to compute data fee for eip-4844 data
blobs, logic of which will be added in later PRs. Also eip-4844 header
verification logic added.
2023-04-16 08:12:40 +00:00
Andrew Ashikhmin
4c8c709408
Use Aura.PosdaoTransition rather than posdaoBlock for fork ID (#7312) 2023-04-14 09:34:25 +00: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
02f6cac7b7
Move hexutil.Bytes to erigon-lib (#7305) 2023-04-13 11:19:02 +00:00
racytech
47fd86e4fb
eip-4844: assigned value to excessDataGas, unused packages removed (#7289)
`excessDataGas` has been partially made eip-4844 ready, so instead of
passing nils to functions, now it actually assigned to some value (it is
expected to be nil until cancun update).
2023-04-12 05:45:44 +00:00
alex.sharov
6e57f3ef92 e3: less conlicts 2023-04-10 09:38:08 +07:00
racytech
6f18ba1458
eip-4844: BlobTx and its components (#7262)
New transaction type added. This transaction differs from previous
transactions in a network encoding. Network encoding of a new
transaction wraps "regular" transaction with additional data: blobs and
kzgs. The network wrapper will be verified by execution layer using this
extra data.
2023-04-07 20:08:14 +00:00
Alex Sharov
e26c607922
e3: combine input tasks channel+heap to class PriorityQueueWithRetry and add docs (#7275) 2023-04-07 06:43:05 +00:00
Alex Sharov
9b5d7357dd
e3: remove sync.Cond and make ownership of first queue clearer (producer will close it). (#7268)
Separate: 
- new tasks coming by channel with limited capacity (touching the limit
will block - like sync.Cond.Wait() does, but composable). as a result -
don't need track queue size (it will not increase conflict-rate).
- re-exec tasks are going to priority-queue (which is also higher
priority than 1-st `chan`).
2023-04-06 09:03:54 +00:00
Alex Sharov
a42d362cbd
move aura epoch data from chainDB to auraDB. remove epochReader parameter from consensus interface (#7250) 2023-04-04 03:30:07 +00:00
ledgerwatch
7258a2b872
Remove BSC support in Erigon (step 1) (#7246)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-04-03 14:46:21 +00:00
racytech
d67087f7fd
eip-4844: ApplyTransaction now expects excessDataGas (#7233)
Tiny addition to ApplyTransaction. Now it expects excessDataGas param so
the BlockContext can be created with it
2023-04-03 14:30:28 +00:00
Alex Sharov
65fcec8d85
e3: replace sync.Cond to fix deadlock (#7243) 2023-04-03 11:33:43 +00:00
Alex Sharov
8720641c3a
e3: register metric the right way (#7244) 2023-04-03 08:55:10 +00:00
Alex Sharov
b34b7e8fd2
e3: add done txs metric (#7241) 2023-04-03 04:54:20 +00:00
Andrew Ashikhmin
02182ee11a
[erigon-lib] Remove ShardingForkTime in favour of CancunTime (#7230)
Pick up https://github.com/ledgerwatch/erigon-lib/pull/963
2023-03-31 09:11:09 +00:00
Alex Sharov
a8e8bf4528
remove simd lib, because it doesn't work with ghcr.io/goreleaser/goreleaser-cross (which producing release binaries) (#7229)
@shyba hi, seems this lib doesn't work with
ghcr.io/goreleaser/goreleaser-cross (which producing release binaries)
removing it for now, feel free to add it in future - if can make it work
with goreleaser-cross
see: https://github.com/ledgerwatch/erigon/issues/7210
2023-03-31 05:07:43 +00:00
Alex Sharov
04b5c0c67b
e4: small tests preparations (#7220) 2023-03-31 02:19:56 +00:00
racytech
04b57904b0
eip-4844: excessDataGas param added to block execution functions (#7217)
Small addition to block execution functions. Now they expect
excessDataGas param so the BlockContext can be created with it.
2023-03-30 20:42:43 +00:00
Andrew Ashikhmin
f590ba3ccb
Remove Sokol (#7224)
Sokol chain is dead: https://blockscout.com/poa/sokol
2023-03-30 14:34:46 +00:00
Alex Sharov
2161c5ed8c
stop using olddb in simulated backend (#7219) 2023-03-30 03:31:15 +00:00
Alex Sharov
592ec1ee0d
e4: step 1 to run tests (#7209) 2023-03-29 14:01:27 +00:00
Alex Sharov
417a437584
Break dependency of ethcfg package to core/consensus/etc... move genesis struct to 'types' package (#7206) 2023-03-29 07:27:06 +00:00
racytech
975e38a800
eip-4844: NewEVMBlockContext now expects excessDataGas (#7203)
Small change in core.NewEVMBlockContext and now it expects
excessDataGas. This will be used in state transition to compute data fee
for eip-4844 data blobs. The logic that computes it will be added in the
next PRs.
2023-03-29 06:39:36 +00:00
racytech
70bc7f7a25
eip-4844: small additions and modified gaspool (#7190)
This PR contains very small EIP-4844 additions. GasPool is modified and
now it is a struct with 2 fields "gas" and "dataGas" (blobs are priced
in dataGas). ExcessDataGas block header field added. ExcessDataGas
needed to compute the data gas price. EIP-4844 helper functions are
added as well.
2023-03-27 21:39:15 +00:00
alex.sharov
0f14970689 kv_temporal lost commit 2023-03-26 12:15:08 +07:00
Alex Sharov
cff73b8aec
add constant kv.Unlim=-1 (#7183) 2023-03-26 03:18:04 +00:00
Alex Sharov
201572c6f5
enable more linters #954 (#7179) 2023-03-25 05:13:27 +00:00
alex.sharov
e0dd48cc67 DomainRange 2023-03-25 11:46:29 +07:00
Alex Sharov
7a51a29991
e3: DomainGetAsOf, DomainRange (#7177) 2023-03-25 03:51:43 +00:00
Alex Sharov
f4fb329c55
e3: remove some iterator (#7174) 2023-03-24 08:36:52 +00:00
Alex Sharov
9001f668a7
go 1.19 atomics (#7164) 2023-03-23 05:11:28 +00:00
Alex Sharov
223fcd178c
e3: domain range api simplify (#7158) 2023-03-22 07:36:03 +00:00
Alex Sharov
0ffaca865e
e3: unionKV limit (#7157) 2023-03-22 06:58:01 +00:00
Alex Sharov
52cb720cdc
e3: remove settings table (#7155) 2023-03-22 05:21:17 +00:00
alex.sharov
94a3257ec7 e4: reset state 2023-03-22 12:06:48 +07:00
Alex Sharov
28c1b1d50d
e4: to use serializev3 (#7154) 2023-03-22 04:53:49 +00:00
Temirlan
4e5dce1365
add flag txpool.commit_every (#7062)
Adds flag _--txpool.commit_every_ to control how often transactions
should be committed to the storage

[Related Issue](https://github.com/ledgerwatch/erigon/issues/7002)
2023-03-22 03:53:47 +00:00
Andrew Ashikhmin
56a3844656
Drop Default from GenesisBlock* functions (#7147)
Small cosmetic changes and clean-ups
2023-03-20 15:44:22 +00:00
Andrew Ashikhmin
4a1c61a031
Schedule mainnet Shapella. Fix BellatrixForkEpoch (#7145)
See https://github.com/ethereum/execution-specs/pull/727. Also,
`BellatrixForkEpoch` should be 144896, not 144869: refer to [the
spec](https://github.com/ethereum/consensus-specs/blob/dev/specs/bellatrix/fork.md).
2023-03-20 12:01:35 +00:00
Alex Sharov
157a380be7
e3: history no auto-increment (#7097) 2023-03-15 08:03:57 +00:00
Victor Shyba
158fb2b606
Optimize memory buffer, simplify set32, use sha256-simd (#7060)
Hi,

I'm syncing Gnosis on a Celeron N5100 to get familiar with the codebase.
In the process I managed to optimize some things from profiling.
Since I'm not yet on the project Discord, I decided to open this PR as a
suggestion. This pass all tests here and gave me a nice boost for that
platform, although I didn't have time to benchmark it yet.

* reuse VM Memory objects with sync.Pool. It starts with 4k as `evmone`
[code
suggested](0897edb001/lib/evmone/execution_state.hpp (L49))
as a good value.
* set32 simplification: mostly cosmetic
* sha256-simd: Celeron has SHA instructions. We should probably do the
same for torrent later, but this already helped as it is very CPU bound
on such a low end processor. Maybe that helps ARM as well.
2023-03-14 07:17:04 +00:00
Jason Yellick
b21569ccc5
Backfill eth getproof tests (#7092)
This PR adds missing tests for eth_getProof and does some mild
refactoring with switching from strings to more strict types. It's
likely best/most easily reviewed commit by commit.

Note, the tests include quite a number of helper types and functions for
doing the proof validation. This is largely because unlike Geth,
Erigon's approach to trie computations only requires serializing the
trie nodes, not deserializing them. Consequently, it wasn't obvious how
to leverage the existing trie code for doing deserialization and proof
checks. I checked on Discord, but, there were no suggestions. Of course,
any feedback is welcome and I'd be happy to remove this code if it can
be avoided.

Additionally, I've opted to change the interface type for `GetProof` to
use a `common.Hash` for the storage keys instead of a `string`. I
_think_ this should be fairly safe, as until very recently it was
unimplemented. That being said, since it's an interface, it has the
potential to break other consumers, anyone who was generating mocks
against it etc. There's additionally a `GetStorageAt` that follows the
same parameter. I'd be happy to submit a PR modifying this one as well
if desired.

Also, as a small note, there is test code for checking storage proofs,
but, storage proofs aren't currently supported by the implementation. My
hope is to add storage proofs and historic proofs in a followup PR.

---------

Co-authored-by: Jason Yellick <jason@enya.ai>
2023-03-14 00:04:52 +00:00
Alex Sharov
f2d99f9d85
e3: split "changed keys" iterator to simplify (#7086) 2023-03-13 08:06:50 +00:00
Alex Sharov
f432cde16b
e3: reconst: run workers in errgroup (#7071) 2023-03-13 04:04:49 +00:00
Giulio rebuffo
dbf1225cb2
Added partial SSZ library (#7083)
Implements SSZ encode/decoding and hashtreeroot for simple list-lacking
data structures. does not account offset case.
2023-03-12 14:41:53 +00:00
Alex Sharov
4ab63db6e2
nil ptr in delete ancient (#7081) 2023-03-11 05:46:32 +00:00
Andrew Ashikhmin
3270720cb7
Remove ETC-specific DAOForkSupport=false functionality (#7075) 2023-03-10 12:10:11 +00:00
Andrew Ashikhmin
2212e21192
Remove archaic eip150Hash functionality (#7074) 2023-03-10 10:55:59 +00:00
Michael Montour
d5fbc5011e
Partial EIP1186 eth_getProof implementation (#6560)
This is a partial implementation of eth_getProof (see issue #1349),
supporting only a request for the latest block and an empty list of
storage keys (i.e. Account proof only). I don't know if there's a better
way of implementing this, but this was what I could come up with.
Posting it here in case it's useful.

Example output:
```
> eth.getProof("0x67b1d87101671b127f5f8714789C7192f7ad340e", [], 'latest')
{
  accountProof: ["0xf90131a0252c9d4ed347b4cf3fdccaea3ccef0a507e6bd4dbe4dcd98609b7195347c4062a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a0e73919d9f472eec11f6da95518503f5527a98b9428f7a02c4f55bf51854214e480a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", "0xf8518080808080a0a00135c9ec2655cb6a47ab7ad27d6fc150d9cba8b3d4a702e879179116a68a60808080808080a02fb46956347985b9870156b5747712899d213b1636ad4fe553c63e33521d567a80808080", "0xf873a02056274a27dd7524955417c11ecd917251cc7c4c8310f4c7e4bd3c304d3d9a79b850f84e808a021e19e0c9bab2400000a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"],
  address: "0x67b1d87101671b127f5f8714789c7192f7ad340e",
  balance: "0x21e19e0c9bab2400000",
  codeHash: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
  nonce: "0x0",
  storageHash: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
  storageProof: []
}
> eth.getBlock('latest').stateRoot
"0x6a0673c691edfa4c4528323986bb43c579316f436ff6f8b4ac70854bbd95340b"
```
2023-03-09 03:04:09 +00:00
Giulio rebuffo
e6ba82ca0b
Added Capella specs support to Erigon-CL (#7051)
Passing consensus-specs tests for Capella. Processing of withdrawals and
ExecutionChanges. efficient non-validation implemented. Refactored:
ExecutionPayload/ExecutionPayloadHeader.
2023-03-07 21:57:18 +00:00
Alex Sharov
b685407175
attempt to fix TestGolangBindings (#7041) 2023-03-07 06:14:35 +00:00
Alex Sharov
d4e25daf22
etl: distinct empty values from nil (#7039)
Reverts ledgerwatch/erigon#7038
2023-03-07 04:19:00 +00:00
Alex Sharov
78aa8652d2
e3: native map instead of btree where can (because e2 experience shows - it's faster) (#7010) 2023-03-07 02:34:30 +00:00
Andrew Ashikhmin
aa9b9bdd1c
Schedule Shapella on Görli/Prater (#7012)
See https://github.com/ethereum/execution-specs/pull/724 &
https://github.com/eth-clients/goerli/pull/160
2023-03-03 13:27:36 +00:00
alex.sharov
086398777e fix headers reset 2023-03-03 09:53:01 +07:00
Andrew Ashikhmin
1dab298db7
Add Prague fork support (#7005)
Prague is the next EL fork after
[Cancun](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md).
This change picks up https://github.com/ledgerwatch/erigon-lib/pull/913,
adds support of the fork, and moves Verkle trees to it.
2023-03-02 17:51:36 +00:00
Anshal Shukla
c4ba26107e
Rpc get code (#6899)
This in conjuction with
[PR#893](https://github.com/ledgerwatch/erigon-lib/pull/893) fixes the
eth_getCode RPC call.
2023-03-02 14:12:16 +00:00
Leonard Chinonso
599fc24aed
Devnet Test for EIP1559 (#6938)
**Current Problem**

When X transactions are created, with M transactions out of them having
`gasFeeCap` greater than the current `baseFeePerGas` for the block, and
N transactions having `gasFeeCap` lower, all X transactions get added to
the yellow pool (baseFee) in the txpool and they never get mined.
However when X transactions all having `gasFeeCap` higher than the
`baseFeePerGas` are created, they all get added to the green pool
(pending) in the txpool and thus get mined.

This phenomenon can be inspected in the
`signEIP1559TxsLowerAndHigherThanBaseFee2` function where the number of
transactions that should have `gasFeeCap` higher than and lower than the
current `baseFeePerGas` is specified in its parameter - `func
signEIP1559TxsLowerAndHigherThanBaseFee2(amountLower, amountHigher
int...`.
When `amountLower` is set as `0`, all transactions created from
`amountHigher` will be mined because they have `gasFeeCap` >
`baseFeePerGas`. When `amountLower` has a value > `0`, all the
transactions created (including transactions created with
`amountHigher`) will go to the yellow pool (baseFee) and thus do not get
mined.
2023-03-02 10:25:11 +00:00
hexoscott
0b19aaaabf
gnosis trace issue fix (#6995)
To fix #6798 

Follows the same pattern as other temporary fixes for BSC.

Tested locally and the transaction in question shows the same behaviour
as nethermind, coming to the same gas used and reverted behaviour by the
end. Tracing the block also works as expected now.

Tracing a transaction after the fork at 21735000 loads up the new
contract as expected as well.
2023-03-01 21:29:10 +00:00
Alex Sharov
a4f69abb97
e3: less locks, less casts (#6991) 2023-03-01 07:59:56 +00:00
alex.sharov
4e5f14c4c1 Revert "e3: faster apply (#6970)"
This reverts commit 4b4d27195c.
2023-03-01 10:11:30 +07:00
Alex Sharov
031292cc83
evm: prealloc zeroes for Resize() (#6624) 2023-03-01 02:43:32 +00:00
nanevardanyan
cf9ee425ed
check for TransactionsV3 flag (#6988) 2023-03-01 02:13:12 +00:00
Giulio rebuffo
f97550c48f
Fixed capella startup for LC (#6989) 2023-02-28 21:17:10 +00:00
Alex Sharov
b3c49af086
e3: aggressive drain resultCh to heap before start conflict-resolution (#6979) 2023-02-27 13:08:33 +00:00
Alex Sharov
4b4d27195c
e3: faster apply (#6970) 2023-02-27 14:57:02 +07:00
Alex Sharov
8bffe4499b
e3: less wal locks (#6971) 2023-02-27 07:03:00 +00:00
Alex Sharov
4d2c3c2522
e3: branchless get (#6969) 2023-02-27 06:57:49 +00:00
Alex Sharov
860f0fd569
evm: remove mutex from journal (#6967) 2023-02-27 05:48:18 +00:00
Alex Sharov
fae889f815
e3: index readers pool (#6954) 2023-02-26 02:04:46 +00:00
Alex Sharov
431fba815f
e3: simplify tracer (#6953) 2023-02-25 12:44:45 +07:00
nanevardanyan
ab6239b30f
WIP: cmd, turbo, core, eth: TransactionsV3 flag and persist in new table (#6754) 2023-02-24 18:49:25 +00:00
Alex Sharov
ddcb1c90cd
e3: don't collect readList in ApplyWorker, because it's conflict-free (#6916) 2023-02-21 05:11:45 +00:00
ledgerwatch
1705a52876
Cleanup in IntraBlockState (#6900)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-02-19 17:19:52 +00:00
alex.sharov
a251da2515 e3: move part to ergion-lib 2023-02-15 11:16:34 +07:00
alex.sharov
917b14962e e3: simplify mutex 2023-02-15 11:07:34 +07:00
alex.sharov
35c1bc07e7 e3: discard history flag 2023-02-15 10:23:19 +07:00
Andrew Ashikhmin
58fcc04575
blockValue should use gasUsed rather than gasLimit (#6875)
Fees going to the gas fee recipient should be based on the actual gas
used (available in the receipt) rather than the gas limit in a
transaction. This fixes Hive test "GetPayloadV2 Block Value".

Also `engine_getPayloadBodiesByRangeV1` params should be encoded as hex
strings.
2023-02-14 15:05:27 +00:00
Andrew Ashikhmin
0a8d4799e2
[AuRa] Enable EIP-170 when EIP-3860 is enabled (#6873) 2023-02-14 11:20:23 +00:00
alex.sharov
dbc3bb178f fix lint 2023-02-14 14:51:03 +07:00
Alex Sharov
d3d88c9ad6
e3: cast keys same way as e2 does (#6870) 2023-02-14 06:38:50 +00:00
Alex Sharov
794051ba0e
e3: int type for size fields to avoid underflow and simplify (#6857) 2023-02-13 05:58:01 +00:00
Alex Sharov
999899d66d
e3: read files list from db (#6833) 2023-02-13 05:17:01 +00:00
alex.sharov
319af1eeca check error in TruncateBlocks 2023-02-12 11:34:08 +07:00
Alex Sharov
320c6b2b7e
Snapshots Indexing: avoid loop with semaphore locking before logging (#6846) 2023-02-12 10:00:42 +07:00
ledgerwatch
f27a94621c
Fix tests after merge (#6841)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-02-11 21:22:17 +00:00
ledgerwatch
ee83447fa1
CL lightclient to create memdb in the tmpdir which gets cleaned up on… (#6829)
… startup

---------

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-02-11 20:44:51 +00:00
Andrew Ashikhmin
3dcdc46d31
Schedule Shanghai fork on Sepolia (#6835)
See https://github.com/ethereum/execution-specs/pull/716
2023-02-10 17:48:06 +00:00
Kian
b40e81bf3a
Fix 'make bindings' (#6824)
Solidity 0.8.0 breaks the current use of `payable` in these test
contracts, resulting in errors like
```
Error: Type address is not implicitly convertible to expected type address payable.
  --> selfDestructor.sol:10:9:
   |
10 |         address payable nil = address(0);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

Related to #6680
2023-02-10 09:03:45 +07:00
Giulio rebuffo
03f737c458
Added processing for Attestation (#6772) 2023-02-03 16:39:09 +01:00
Alex Sharov
aaec53857f
e3: last reader to close/remove merged files (marked as canDelete) inside tx.Rollback() (#6738) 2023-02-01 15:44:13 +07:00
Alex Sharov
dfca60c054
e3: indices wal - to reuse etl collector (#6757) 2023-02-01 10:02:29 +07:00
Andrew Ashikhmin
de5a061fdf
Remove StarknetTransaction and friends (#6745) 2023-01-30 16:56:58 +01:00
Alex Sharov
44f7ff3c95
e3: small rename (#6734) 2023-01-29 10:56:14 +07:00
Alex Sharov
9287a2202b
e3: eth_getModifiedAccountsByNumber (#6733) 2023-01-29 10:10:39 +07:00
Alex Sharov
2998aa6386
e3: debug_accountRange (#6726) 2023-01-28 12:03:24 +07:00
Alex Sharov
b99e4abb3e
move math big constants to erigon-lib (#6719) 2023-01-27 11:39:34 +07:00
Max Revitt
6559c15ebb
feat(trace): use specific error string (#6696)
In v2.36.0 we correctly trace this transaction, however due to a code
ordering issue in previous releases, there was an 'out of gas' response,
because we fell through to the code here where
ErrContractAddressCollision will be returned as such. This change isn't
the fix, but ensures the actual error is returned.
2023-01-26 15:10:51 +01:00
Andrew Ashikhmin
d12fda5cbd
Switch AccessList, IntrinsicGas, SafeAdd/Mul to erigon-lib (#6709)
Reduce code duplication.
2023-01-26 12:26:12 +01:00
Alex Sharov
30fefd1fe1
e3: trace_filter on iter (#6707) 2023-01-26 17:24:29 +07:00
Alex Sharov
79b42c9dc0
e3: ots_getContractCreator (#6705) 2023-01-26 16:34:52 +07:00
Alex Sharov
82c478a419
e3: getLogs on iterators (#6683) 2023-01-25 16:29:41 +07:00
Giulio rebuffo
f44b22f066
Shangai Compatible embedded CL lightclient (#6688)
* LightClientHeader: Capella
* Added versions to lightclient
* TODO: Capella->Bellatrix transition
2023-01-24 17:36:02 +01:00
Alex Sharov
49f8d4c4ad
Use shared genesis db to speedup tests (#6681) 2023-01-24 14:43:52 +07:00
alex.sharov
9bc2545e44 Revert "Revert "revert: shared genesis db (#6594)""
This reverts commit be3e118cf5.
2023-01-24 13:04:39 +07:00
alex.sharov
be3e118cf5 Revert "revert: shared genesis db (#6594)"
This reverts commit 9e452fe8
2023-01-24 13:04:02 +07:00
Alex Sharov
bad616cb8e
e3: use historyReader constructor in tests (#6677) 2023-01-24 12:43:04 +07:00
Alex Sharov
71067a69d1
e3: storageRangeAt fix NextPage value (#6676) 2023-01-24 11:22:50 +07:00
Alex Sharov
539eaf0a51
e3: prepare trace_transaction env without execution (#6675) 2023-01-24 11:18:32 +07:00
Alex Sharov
4fbbdf9186
e3: move txnum to erigon-lib (#6663) 2023-01-22 19:39:33 +07:00
Alex Sharov
0ee8c175d9
e3: simplify history reader (#6659) 2023-01-22 16:42:24 +07:00
Alex Sharov
43d39762c2
e3: ots_searchTransactionsBefore (#6656) 2023-01-22 15:35:18 +07:00
Giulio rebuffo
0eebd61ab8
separation of state: a continuation (#6647) 2023-01-21 22:33:50 +01:00
Alex Sharov
57b1bdd54c
e3: rename "stream" to "iter" (#6651) 2023-01-21 11:11:47 +07:00
Alex Sharov
b71725ecb3
e3: reverse/limited iterators, stream tooling (#6637) 2023-01-20 18:08:20 +07:00
Devon Bear
b8fcb775e3
impr(evm): Move callstack depth to the interpreter (#6632)
This is a more logical / semantically correct place to keep track of the
call stack depth.
2023-01-19 23:52:08 +00:00
Andrew Ashikhmin
c352d78457
Wei -> Gwei tests update (#6619)
Pick up https://github.com/ethereum/tests/pull/1147
2023-01-18 17:47:59 +01:00
Devon Bear
00c73f0c20
clean: VMInterpreter and Fix Linter (#6611) 2023-01-18 06:44:21 +00:00
Devon Bear
6443279775
impr(interpreter): Convert Interpreter to use an Interface in lieu of *EVM (#6606)
Helps with reusability of the Interpreter.
2023-01-17 21:53:24 +00:00
hexoscott
75a3f08e9d
txpool changes for eip-3860 (#6499)
pass in new values to the txpool on creation to handle shanghai changes.
2023-01-17 11:07:57 +00:00
Andrew Ashikhmin
f151a52c0e
Withdrawal amount in GWei (#6578)
See https://github.com/ethereum/execution-apis/pull/354 &
https://github.com/ethereum/EIPs/pull/6325.

Prerequisite: https://github.com/ledgerwatch/erigon-lib/pull/832.
2023-01-17 11:22:08 +01:00
Alex Sharov
9e452fe8c4
revert: shared genesis db (#6594)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-17 17:06:59 +07:00
Alex Sharov
d317722aef
e3: storageRangeAt (#6580) 2023-01-17 14:16:36 +07:00
alex.sharov
c3d35c0a6a fix tests 2023-01-17 13:59:31 +07:00
Devon Bear
4bfcc1ee5c
Convert *vm.EVM to vm.VMInterface in Tracers (#6590)
Useful for integration with external tools as one can just utilize an
interface opposed to having to import and build a real EVM object.
2023-01-16 22:28:50 +00:00
hexoscott
7dcbfbc283
reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
Willian Mitsuda
c738045557
Fix err being ignored (#6572)
err is being ignored, so it silently fails reset when new table is not
whitelisted
2023-01-13 17:46:32 +07:00
Andrew Ashikhmin
58b3016c80
Switch validateAndStorePayload to Body.RawBody() (#6568)
Ensure that withdrawals are not lost in `validateAndStorePayload`.
2023-01-12 14:58:36 +01:00
Alex Sharov
41e9356f61
e3: stream.ToBitamp() (#6562) 2023-01-12 09:58:21 +07:00
Alex Sharov
731569bbb7
e3: invalid txnum table (#6540) 2023-01-12 09:31:41 +07:00
Max Revitt
4d09a697d0
GetPayloadV2 change (#6554)
- calculates blockValue for updated engine_getPayloadV2 spec
- adds tests for pre/post Shanghai RawBody RLP
2023-01-11 18:33:55 +01:00
Giulio rebuffo
4bee05dd12
Added ETH1 Block SSZ Hashing to CL (#6549)
more of SSZ again.
2023-01-11 17:18:14 +01:00
Alex Sharov
2f97c7bf8b
extract traceFilterBitmaps method (prepare for kv.temporal) (#6553) 2023-01-11 15:01:18 +07:00
Andrew Ashikhmin
19af2009dc
Remove unused Transaction.Size (#6545) 2023-01-10 11:03:34 +01:00
Alex Sharov
7c2ed8e01f
mdbx: v0.12.3 (#6521) 2023-01-10 09:15:18 +07:00
Giulio rebuffo
cdf15e9368
added SSZ encodings for withdrawals (#6538)
This PR adds SSZ hash and encode/decode to Withdrawal object.
2023-01-09 18:02:55 +01:00
Andrew Ashikhmin
1968fda27f
[Clean-up] Switch protocol to types.(Raw)Body (#6537)
Reduce code duplication.
2023-01-09 14:39:49 +00:00
Alex Sharov
2621ef45f6
e3: fix trace json (#6535) 2023-01-09 17:33:18 +07:00
Alex Sharov
088757ed07
e3: domain to used blockNumber for e2 (#6534) 2023-01-09 16:25:35 +07:00
Alex Sharov
f3636c2ad2
kv_temporal: 2nd key for domain (#6533) 2023-01-09 15:16:07 +07:00
Giulio rebuffo
599480c5e0
ExecutionPayloaHeader: ssz support for withdrawals root (#6524)
I do not recommend this.
2023-01-09 01:04:05 +01:00
Alex Sharov
720b5f77d6
e3: bsc oom fix (#6526) 2023-01-08 15:07:34 +07:00
Alex Sharov
08904da83e
e3: fix couple deadlocks in parallel exec (#6525) 2023-01-08 10:00:41 +07:00
Andrew Ashikhmin
ac1428e15e
Amend EIP-3860 per EIPs/pull/6249 (#6502)
See https://github.com/ethereum/EIPs/pull/6249 and
https://github.com/ethereum/tests/pull/1125
2023-01-06 17:46:27 +01:00
Andrew Ashikhmin
4f536abe46
Unify forkSegment with HeaderAndBody (#6517)
Small refactoring after PR #6515.
2023-01-06 15:12:07 +01:00
Alex Sharov
4c3bb1cca5
kv_temporal: DomainGet (#6511) 2023-01-06 14:27:54 +07:00
Alex Sharov
c38868cc46
better pagesize error message (#6497) 2023-01-04 13:07:46 +07:00
Alex Sharov
0483fc5539
integration: cancel warmup (#6494) 2023-01-03 12:51:00 +07:00
Alex Sharov
17e0afbe44
"erigon snapshots retire" save progress (#6486) 2023-01-02 12:38:03 +07:00
alex.sharov
f0be579fd1 warmup: 100K prefixes 2023-01-02 10:50:08 +07:00
alex.sharov
8ffdda14f2 warmup: million prefixes 2023-01-02 10:47:06 +07:00
Andrew Ashikhmin
58893937b0
core/vm: Make INVALID a defined opcode (#6477)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/24017.

* core/vm: Define 0xfe opcode as INVALID

* core/vm: Remove opInvalid as opUndefined handles it

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>

Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
2022-12-30 17:13:54 +01:00
Alex Sharov
4a9c871628
a bit rename 22 to v3 (#6476) 2022-12-30 21:53:42 +07:00
Andrew Ashikhmin
a369fd026f
core/vm: clean up contract creation error handling (#6475)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/22766.

Do not keep separate flag for "max code size exceeded" case, but instead
assign appropriate error for it sooner.

Co-authored-by: Paweł Bylica <chfast@gmail.com>
2022-12-30 15:19:16 +01:00
Alex Sharov
9159f7e8aa
"integration stage_exec --warmup" (#6471) 2022-12-30 15:44:50 +07:00
Alex Sharov
b0af04f2df
bsc: incrementally calc and store all old snapshots. slower initial stage_snapshots, but faster restart during initial sync (#6457) 2022-12-30 12:44:54 +07:00
alex.sharov
72ffce2ba8 e3: more print_stages info 2022-12-29 15:18:11 +07:00
Alex Sharov
ca3bc54428
Shared genesis db (#6465) 2022-12-29 14:47:17 +07:00
alex.sharov
92c95e6e68 cleanup 2022-12-29 11:02:33 +07:00
alex.sharov
a893899fc2 save 2022-12-29 11:02:11 +07:00
alex.sharov
9efb8e838b save 2022-12-29 10:09:09 +07:00
Andrew Ashikhmin
0fdd60a0d1
Execution Spec Tests & HashCheck() (#6444)
Run tests from a new repo
https://github.com/ethereum/execution-spec-tests.

Also introduce `HashCheck()` function that checks correctness of block's
uncle, transaction, and withdrawals hashes.
2022-12-28 17:01:40 +01:00
Andrew Ashikhmin
b4a73e0579
Fix intra_block_state_test (#6458)
Postfix after PR #6440
2022-12-28 12:26:37 +01:00
Andrew Ashikhmin
714888b016
HashBuilder: fix top node shorter than 32 bytes (#6456)
Prior to withdrawals, it was extremely unlikely to have short (RLP < 32)
top trie nodes outside test scenarios.
2022-12-28 11:58:37 +01:00
Alex Sharov
fc71d441a6
mdbx_to_mdbx better logging (#6455) 2022-12-28 13:27:42 +07:00
Alex Sharov
fa6f6038e7
kv: tx.Prefix method (#6441) 2022-12-26 17:58:21 +07:00
ledgerwatch
387b4d7f35
Native tracers step 10 - remove duplicate SelfDestruct capture, clean up (#6440)
Moved some of the tracers to `eth/tracers/logger` to make it more
similar to go-ethereum.

Removed Erigon-specific `Capture-` functions

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-26 04:56:39 +00:00
ledgerwatch
24040f3044
Native tracers step 9 - add native tracers (#6434)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-25 07:28:41 +00:00
Alex Sharov
45fd92f17b
exclude genesis from "append with gap" assert (#6428) 2022-12-24 14:28:02 +07:00
Alex Sharov
ade933be6b
kv_remote: server to support thread-safe multi-streams per 1 tx (#6402) 2022-12-24 13:11:15 +07:00
ledgerwatch
f364eff389
Native tracers step 7 - restructure js tracer files (#6415)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-23 18:10:37 +00:00
Andrew Ashikhmin
4931f113c2
Add override.shanghaiTime flag (#6414)
and remove `--override.terminaltotaldifficulty` &
`--override.mergeNetsplitBlock`
2022-12-23 17:06:56 +01:00
ledgerwatch
a49e287618
Native tracers step 6: Rename Tracer to EVMLogger, reduce args CaptureExit (#6410)
Getting closer to Geth's tracer interfaces

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-23 05:43:08 +00:00
Alex Sharov
130ab85bea
e3: kv/temporal prototype 3 (#6395) 2022-12-22 09:37:32 +07:00
Andrew Ashikhmin
49bb63661f
core/vm: derive maxStack from numPop & numPush (#6397) 2022-12-21 14:55:00 +01:00
Andrew Ashikhmin
dc248c5ea4
core/vm: Move interpreter.ReadOnly check into the opcode implementations (#6396)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/23970

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-12-21 12:44:01 +01:00
Andrew Ashikhmin
5582435a95
core/vm: Simplify error handling in interpreter loop (#6394)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/23952

Co-authored-by: Paweł Bylica <chfast@gmail.com>
2022-12-21 11:57:53 +01:00
Andrew Ashikhmin
0986342690
core/vm: remove unused NewEVMInterpreterByVM (#6393) 2022-12-21 09:51:00 +01:00
Giulio rebuffo
173d11c43c
removed retry logic from Erigon-CL (#6389) 2022-12-20 22:11:08 +01:00
Alex Sharov
0ce84e41e1
integration: warmup staeg (#6388) 2022-12-20 22:59:23 +07:00
Andrew Ashikhmin
06df4333b2
core/vm: avoid memory expansion check for trivial ops (#6383)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/24048

Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-12-20 16:47:51 +01:00
alex.sharov
dd9f117a0c save 2022-12-20 22:27:11 +07:00
Max Revitt
4bdb35f94c
Withdrawals part 2 (#6180)
Continuation of PR #6009. Storage and retrieval of withdrawals.

- [x] storage of withdrawals on writeblock
- [x] composite key (block number | block hash)
- [x] value ([]withdrawal)
- [x] retrieval of withdrawals with block
- [x] tests around storing/retrieving withdrawals
- [x] tested in hive
- [x] commits tidied


## Hive Failures
- [x] Withdrawals Fork on Block 2
- [x] Withdrawals Fork on Block 3
- [ ] Sync after 2 blocks - Withdrawals on Block 1 - Single Withdrawal
Account - No Transactions ( Syncing client rejected valid chain)
- [ ] Sync after 2 blocks - Withdrawals on Block 1 - Single Withdrawal
Account (Timeout while waiting for secondary client to sync)
- [ ] Sync after 2 blocks - Withdrawals on Genesis - Single Withdrawal
Account (Timeout while waiting for secondary client to sync)
- [ ] Sync after 2 blocks - Withdrawals on Block 2 - Single Withdrawal
Account - No Transactions (Syncing client rejected valid chain)
- [ ] Sync after 2 blocks - Withdrawals on Block 2 - Single Withdrawal
Account (Timeout while waiting for secondary client to sync)
- [ ] Sync after 128 blocks - Withdrawals on Block 2 - Multiple
Withdrawal Accounts (Unexpected error on BalanceAt: Post
"http://172.17.0.4:8545/": context deadline exceeded, expected=<None>)
- [ ] Withdrawals Fork on Block 1 - 8 Block Re-Org, Sync (Expected no
error on EngineNewPayloadV2: error=Post "http://172.17.0.4:8551/":
context deadline exceeded)
- [ ] Withdrawals Fork on Block 8 - 10 Block Re-Org Sync (Expected no
error on EngineNewPayloadV2: error=Post "http://172.17.0.4:8551/":
context deadline exceeded)
- [ ] Withdrawals Fork on Canonical Block 8 / Side Block 7 - 10 Block
Re-Org Sync (Expected no error on EngineNewPayloadV2: error=Post
"http://172.17.0.4:8551/": context deadline exceeded)
- [ ] Withdrawals Fork on Canonical Block 8 / Side Block 9 - 10 Block
Re-Org Sync (Expected no error on EngineNewPayloadV2: error=Post
"http://172.17.0.4:8551/": context deadline exceeded)
2022-12-20 09:09:04 +00:00
Andrew Ashikhmin
31d30df59f
core/vm: fill gaps in jump table with opUndefined (#6372)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/24031

Co-authored-by: Paweł Bylica <chfast@gmail.com>
2022-12-20 08:18:24 +01:00
Alex Sharov
cce0f251b4
e3: kv/temporal prototype 2 (#6377) 2022-12-20 09:28:10 +07:00
Andrew Ashikhmin
e5f818c832
core/vm: remove unused 'unofficial' opcodes (#6371)
Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-12-19 14:47:29 +01:00
Andrew Ashikhmin
a00a4000a4
core/vm: simplify op lookup in contract (#6370)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/23974

Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
2022-12-19 14:10:45 +01:00
Alex Sharov
dfa6505f93
e3: kv/temporal prototype (#6367) 2022-12-19 15:38:54 +07:00
ledgerwatch
97c9a9108d
Native tracers - step 4 (#6363)
Remove `callType` argument from `CaptureStart`, and change `callType
vm.CallType` to `typ vm.OpCode` in `CaptureEnter` and move to the first
position (as it is in geth)

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-19 03:12:08 +00:00
ledgerwatch
0761671607
Native tracers step 3 (#6362)
Remove `env` argument from all Capture functions except for
`CaptureStart`

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-18 17:06:40 +00:00
ledgerwatch
b8c6a4d263
Native tracers - step 2 (#6360)
Splitting function `CaptureStart` into `CaptureStart` (when depth == 0)
and `CaptureEnter` (when depth > 0), while removing argument `depth`.
Same with splitting `CaptureEnd` into `CaptureEnd` and `CaptureExit`

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-18 16:11:31 +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
c5d720591a save 2022-12-18 11:10:40 +07:00
Alex Sharov
4ef39ea43c
unify logs a bit (#6354) 2022-12-18 09:23:11 +07:00
Andrew Ashikhmin
0fc2022a0e
Extend fork ID to timestamp-based forks (#6324)
Starting from
[Shanghai](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md),
forks are based on timestamps rather than block heights (see PR #6238).
This PR extends [EIP-2124](https://eips.ethereum.org/EIPS/eip-2124) Fork
ID to include timestamp-based blocks. See also
https://github.com/ethereum/go-ethereum/pull/25878.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2022-12-16 12:08:54 +01:00
Alex Sharov
43f83cd7d8
e3: use of ordered-map generic (#6335) 2022-12-16 13:59:57 +07:00
Roberto Bayardo
cf6173d042
Make empty but non-nil Withdrawals arrays decode as empty but non-nil. (#6291) 2022-12-15 08:52:14 +00:00
Alex Sharov
863e1ed07b
e3: handle "kill -9" during merge, auto-hide history .ef file if not corresponding .v file (#6304) 2022-12-15 13:49:06 +07:00
Alex Sharov
ce9203d80d
e3: more aggressive prune #780 (#6299) 2022-12-14 09:50:48 +07:00
ledgerwatch
556a81ce6f
Fix tests (#6278)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-11 14:57:24 +00:00
Alex Sharov
7a055a51d4
e3: graceful shutdown (#6272) 2022-12-11 13:15:55 +07:00
Andrew Ashikhmin
ecefc53dd0
Remove Ropsten & Fermion (#6262)
See https://blog.ethereum.org/2022/11/30/ropsten-shutdown-announcement
2022-12-10 22:55:31 +00:00
ledgerwatch
0a31f5ac2a
Workaround for the code history of BSC system contracts (#6274)
Works around a flaw in the upgrade logic of the system contracts. Since
they are updated directly, without first being self-destructed and then
re-created, the usual incarnation logic does not get activated, and all
historical records of the code of these contracts are retrieved as the
most recent version. This problem will not exist in erigon3, but until
then, a workaround will be used to access code of such contracts through
a special structure, `SystemContractCodeLookup`

Fixes https://github.com/ledgerwatch/erigon/issues/5865

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-10 22:41:04 +00:00
ledgerwatch
b5a7faa8db
[e3] Incremental reconstitution (#6270)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-10 09:34:17 +00:00
ledgerwatch
35c279d291
Optimize modexp (#6247)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-08 06:43:40 +00:00
Andrew Ashikhmin
7eab12d90d
Shanghai & Cancun forks should be based on timestamp (#6238) 2022-12-07 18:45:44 +01:00
hexoscott
499c40fe4f
fix for nil pointer dereference in mining (#6237) 2022-12-07 16:54:22 +00:00
Krishna Upadhyaya
d5199f521b
Added delhiBlock for mumbai-hard-fork (#6233) 2022-12-07 18:34:14 +07:00
calmbeing
0ad765930d
Apply BSC Gibbs upgrade for mainnet (#6211)
For issue #6163, based on pr #5359 of Gibbs , Supported BSC mainnet
Gibbs hardfork
2022-12-07 18:20:14 +07:00
Alex Sharov
12ee33a492
e3: don't put nil to pool (#6219) 2022-12-06 13:07:16 +07:00
Alex Sharov
4e25872e91
e3: use fact that lifecycle of readList smaller than State22 and RoTx (#6212) 2022-12-06 10:11:03 +07:00
Alex Sharov
f9cf18a4ac
e3: pool read list (#6210) 2022-12-05 18:48:08 +07:00
Alex Sharov
061c4ef744
E3: some clean (#6209) 2022-12-05 10:23:49 +07:00
Håvard Anda Estensen
1398703bc5
Use hex package to convert bytes to string (#6205) 2022-12-05 09:06:16 +07:00
Alex Sharov
e3085f9290
e3: experiment with btree "path hint" (#6158) 2022-12-04 18:15:28 +07:00
Alex Sharov
4ffd50c716
hashers to use sync.pool (#6200)
for https://github.com/ledgerwatch/erigon/issues/6195
2022-12-04 17:23:44 +07:00
Alex Sharov
60802ebc78
evm: one pointer is enough (#6198) 2022-12-04 12:40:03 +07:00
Nicolas Gotchac
961a0070cc
Fix trace error in Polygon | Pass Engin to the Base API (#6131)
So there is an issue with tracing certain blocks/transactions on
Polygon, for example:
```
> '{"method": "trace_transaction","params":["0xb198d93f640343a98f90d93aa2b74b4fc5c64f3a649f1608d2bfd1004f9dee0e"],"id":1,"jsonrpc":"2.0"}'
```
gives the error `first run for txIndex 1 error: insufficient funds for
gas * price + value: address 0x10AD27A96CDBffC90ab3b83bF695911426A69f5E
have 16927727762862809 want 17594166808296934`

The reason is that this transaction is from the author of the block,
which doesn't have enough ETH to pay for the gas fee + tx value if he's
not the block author receiving transactions fees.

The issue is that currently the APIs are using `ethash.NewFaker()`
Engine for running traces, etc. which doesn't know how to get the author
for a specific block (which is consensus dependant); as it was noting in
several TODO comments.

The fix is to pass the Engine to the BaseAPI, which can then be used to
create the right Block Context. I chose to split the current Engine
interface in 2, with Reader and Writer, so that the BaseAPI only
receives the Reader one, which might be safer (even though it's only
used for getting the block Author).
2022-12-04 12:17:39 +07:00
Alex Sharov
63b88c7d16
use crypto pool (#6197) 2022-12-04 11:59:02 +07:00
Alex Sharov
c401a2e9d2
e3: experiment with Ibs.Reset (#6159) 2022-12-04 11:45:06 +07:00
Alex Sharov
82c7779a85
evm: txContext.gasPrice to uint256 type (#6188) 2022-12-04 11:44:50 +07:00
Håvard Anda Estensen
31ec791d5a
Avoiding leaking the popped item (#6193)
Set the deleted item to its zero val so it can be garbage collected.
2022-12-04 11:17:02 +07:00
Alex Sharov
0efda1f19f
trace: change type of self destruct arg to uint256 (#6189) 2022-12-03 21:43:53 +07:00
Alex Sharov
9b65c533c9
e3: optimize incremental hashstate (#6179) 2022-12-03 12:23:01 +07:00
Giulio rebuffo
1fd3a01edf
Added Consensus Layer staged sync (#6183) 2022-12-03 03:16:26 +01:00
Alex Sharov
c7c445e167
e3: reset without race (#6177) 2022-12-02 11:46:25 +07:00
Alex Sharov
509a8d9b50
e3: reset table (#6176) 2022-12-02 09:17:05 +07:00
Andrew Ashikhmin
d82c778ab3
Withdrawals part 1 (#6009)
This PR partially implements
[EIP-4895](https://eips.ethereum.org/EIPS/eip-4895): Beacon chain push
withdrawals as operations. The new Engine API methods
(https://github.com/ethereum/execution-apis/pull/195) are implemented.

_Body downloader and saving withdrawals into DB are not implemented
yet!_
2022-12-01 09:15:01 +01:00
Alex Sharov
fd3c44f6e1
e3: fix dao integration test (#6171) 2022-12-01 14:42:39 +07:00
alex.sharov
5d9e74d39c save 2022-12-01 13:47:35 +07:00
Alex Sharov
cb8f609dc0
e3: fix nil ptr bsc (#6162) 2022-11-30 18:24:42 +07:00
Andrew Ashikhmin
400ad1ab09
Update EIP-3860 according to ethereum/EIPs/pull/6040 (#6161)
See https://github.com/ethereum/EIPs/pull/6040 &
https://github.com/ethereum/tests/pull/1105
2022-11-30 12:19:16 +01:00
alex.sharov
948b325062 save 2022-11-30 14:59:08 +07:00
Alex Sharov
7239387de0
fix devel build (#6154) 2022-11-30 08:35:31 +07:00
Alex Sharov
60cb4e2bbb
evm tracing interface to use uint256, to avoid value.ToBig() allocations (#5781) 2022-11-30 08:31:39 +07:00
Alex Sharov
16cd87748f
E3: fix unwind changes visibility (#6147) 2022-11-30 08:31:13 +07:00
J1ang
83dae8dad3
feat: enhance API erigon_getLatestLogs (#6078)
feat:
1. `erigon_getLatestLogs` doesn't have to match the exact position of
the topics. It will match logs that contain the topics regardless of the
topics' position with original bloom filter. And it accepts `blockCount`
& `crit.ToBlock` params for better pagination.
2022-11-29 15:14:41 +07:00
hexoscott
0094d1301a
reusable evm caller for purpose of eth_estimateGas (#6112)
One simple change to send the header in rather than the body allowing
re-use in a loop which saves the copy call when looping.

The other one for a reusable evm seems potentially dangerous so feedback
more than welcome on that one, local testing shows it gains me around
6k±rps so if it's safe is a good win, but I feel it will need more work.
I could only validate against goerli chain which seems to always return
the same value for eth_estimateGas so if anybody could validate it
against another chain that would be awesome.
2022-11-28 09:03:03 +07:00
Giulio rebuffo
54d1895542
updated go-verkle (#6126) 2022-11-26 19:36:10 +01: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
Philippe Schommers
6f61f556a2
test: add fork id tests for Gnosis and Chiado (#6110)
Feels like there's an issue with the latest hardfork
(https://docs.gnosischain.com/specs/hard-forks/21735000), as the fork id
didn't change?

Related: https://github.com/NethermindEth/nethermind/pull/4925
2022-11-22 16:03:36 +01:00
Andrew Ashikhmin
0b28c7ad13
Support genesis constructors for Chiado (#6103)
This is a continuation of PR #6058 and fixes Chiado genesis state root
by supporting genesis constructors (deployment code).
2022-11-21 17:21:59 +01:00
Alex Sharov
9bcd7fe6c3
e3: reduce state write lock (#6096) 2022-11-21 10:38:22 +07:00