Commit Graph

3119 Commits

Author SHA1 Message Date
Andrew Ashikhmin
a47e49ced6
Fix fork ID test for Chiado (#7576)
Fix a test after PR #7575
2023-05-25 07:59:33 +02:00
Alex Sharov
000dda6a37
blockReader in tests, step7 (#7574) 2023-05-25 10:56:59 +07:00
Alex Sharov
0c399e5082
blockReader tests, step5 (#7572) 2023-05-24 17:41:24 +07:00
Alex Sharov
179b138000
add blockReader to mining, blockchain_test (#7569) 2023-05-24 13:53:22 +07:00
Giulio rebuffo
faf62a0c11
Caplin: Adding SSZ generics (#7542)
This PR makes the SSZ encodings less demented and more compact/flexible
overall
2023-05-23 20:58:34 +02:00
Alex Sharov
63afe65686
Use BlockReader in ForkValidator, CliqueAPI (#7562) 2023-05-23 14:49:17 +07:00
Alex Sharov
4d0dee6fb0
Introduce BlockWriter object (txsV3 step 0) (#7559) 2023-05-22 15:49:21 +07:00
racytech
65efc92af3
eip-4844: vm and engine_api extensions, minor fixes/changes (#7514) 2023-05-19 18:43:04 +01:00
ledgerwatch
b382f96f6c
Introduce logger into etl (#7537)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-05-18 21:20:07 +01:00
ledgerwatch
e75ea786c0
[devnet tool] separate logging (#7526)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-05-17 07:36:06 +01:00
Andrew Ashikhmin
ea9712f858
Schedule Shapella on Chiado (#7518)
See https://github.com/NethermindEth/nethermind/pull/5160,
https://github.com/NethermindEth/nethermind/pull/5688, and
https://github.com/gnosischain/configs/pull/11
2023-05-16 23:50:09 +02:00
Alex Sharov
7a4114d55d
cmd/evm: genesis db cleanup (#7517) 2023-05-15 11:07:13 +07:00
Roberto Bayardo
8356f3a320
use ssz from updated erigon-lib (#7490)
ssz/clonable interfaces have been moved to erigon-lib so they can be
shared with the txpool code there
2023-05-11 12:54:20 +01:00
Andrew Ashikhmin
771c6fc202
Rename Serenity consensus engine to Merge (#7475)
[EIP-2982](https://eips.ethereum.org/EIPS/eip-2982) "Serenity Phase 0"
was superseded by [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675)
"Upgrade consensus to Proof-of-Stake"
2023-05-09 18:45:33 +01:00
racytech
42e8db3958
eip-4844: modified DecodeTransaction version 1 (#7442)
Blob transactions are SSZ encoded, so it had to be added to decoding.
There are 2 encoding forms: `network` and `minimal` (usual). Network
encoded blob transactions include "wrapper data" which are `kzgs`,
`blobs` and `proofs`, and decoded by `DecodeWrappedTransaction`. For
previous types of transactions the network encoding is no different.
Execution-payloads / blocks use the minimal encoding of transactions. In
the transaction-pool and local transaction-journal the network encoding
is used.

Concerns: 
1. Possible performance reduction caused by these changes, not sure if
streams are better then slices. Go slices in this modifications are
read-only, so they should be referred to the same underlying array and
passed by a reference.
2. If `DecodeWrappedTransaction` and `DecodeTransaction` will create
confusion and should be merged into one function.
2023-05-09 18:44:53 +01:00
Andrew Ashikhmin
f3144a6ed0
Proper Gnosis Chain rewards in trace_block (#7473) 2023-05-09 17:19:23 +02:00
Alex Sharov
acd9a25321
e4: chain_makers to not work on PlainState (#7470) 2023-05-09 11:50:28 +07:00
Alex Sharov
d9abfd826f
e4: rename HistoryReaderV4 (#7461) 2023-05-08 15:44:19 +07:00
Alex Sharov
f28f97acc9
history_reader_v3: must always return accounts encoded as v3 (#7460) 2023-05-08 15:30:15 +07:00
Alex Sharov
231d128d91
e3: parallel exec docs (#7459) 2023-05-08 14:32:12 +07: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
ledgerwatch
fdd385cef1
[Devnet tool] Side-quest to improve logging - part 1 (#7445)
This is the beginning of the series of changes to make it possible to
run multiple instances of erigon inside a single process (as devnet tool
does), with the logging from these processes going to respective log
files correctly.
This is the first part where the initial infrastructure is being
established

---------

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-05-07 07:28:15 +01:00
Enrique Jose Avila Asapche
fbd18516ae
Deneb container changes beacon-chain (#7420)
Adding container changes for Deneb:
https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/beacon-chain.md

Changed to use pointers for BlobSideCar
 
 #7389
2023-05-06 18:50:58 +02:00
Giulio rebuffo
43b09a7f55
Refactor of ssz interface (#7439)
Also added a better way to copy and the hasher
2023-05-05 11:19:24 +02:00
Alex Sharov
268674cdde
e4: tests compat (#7436) 2023-05-04 11:30:21 +07:00
alex.sharov
461b30931b e4: tests compat 2023-05-04 11:03:56 +07:00
alex.sharov
644e03c108 e4: tests compat 2023-05-04 11:00:10 +07:00
Roberto Bayardo
d0a6d20ca2
update kzg dependencies (#7432)
Update to latest erigon-lib which now has the kzg context and update
crate-crypto to latest.

---------

Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2023-05-04 10:36:26 +07:00
racytech
40947f6c98
eip-4844: adding data_gas to gaspool (#7428)
Adding `data_gas` to gas pool. EIP-4844 gas pool includes data_gas which
is used to fee blob transactions.
2023-05-03 09:02:30 +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
Alex Sharov
419cab55ba
e3: dont fetch code hash in unwind (#7416) 2023-05-01 10:16:59 +07:00
racytech
726ce264ef
eip-4844: RPCTransactions to support BlobTx (#7407)
Small additions to support eip-4844 transaction marshalling
2023-04-30 14:03:38 +07:00
racytech
f31d2b097d
eip-4844: Unwrap() additional tx method (#7410)
Transaction extension to support BlobTxWrapper (or network
representation of BlobTx). BlobTxWrapper wraps BlobTx with additional
data: blobs, commitments and proofs. Unwrap() returns unwrapped tx if
its network tx, otherwise returns itself.
2023-04-30 14:03:15 +07:00
Alex Sharov
4344136973
e3: rethink meaning of kv_temporal.BeginRw() (#7413) 2023-04-30 10:08:41 +07:00
racytech
631681ccfd
eip-4844: receipts to include dataGasPrice and dataGasUsed (#7385)
Small additions to block receipts. Now it includes `dataGasPrice` and
`dataGasUsed`. `dataGas` is a new type of a gas and blobs are priced in
it.
2023-04-28 17:53:43 +01:00
ledgerwatch
9b5b24a0b3
Fix lint (#7399)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-04-27 13:39:27 +01:00
Alex Sharov
ded8283df7
erigon backup: v0 of sub-command (#7396) 2023-04-27 10:42:12 +07:00
Alex Sharov
367f3e9afa
e3: log slow (unclosed) contexts to detect leaks (#7375) 2023-04-24 12:52:15 +07: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
Anshal Shukla
bc8d292ef6
Update matic token contract codes (#7324)
Co-authored-by: Anshal Shukla <ashukla@Polygon-HYDF2D07MC.local>
2023-04-21 09:32:36 +07:00
Alex Sharov
c39cc6a441
Test squash (#7346) 2023-04-19 15:42:37 +07:00
alex.sharov
688f3838b8 fix import cycle in tests 2023-04-19 15:41:12 +07:00
alex.sharov
0b778b9422 fix import cycle in tests 2023-04-19 15:39:45 +07:00
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