Commit Graph

4647 Commits

Author SHA1 Message Date
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
Alex Sharov
74e08e197d
e3: remove files when no readers (#7370) 2023-04-23 11:55:16 +07:00
alex.sharov
f3aefe2fc0 set default db.size.limit to 7gb (as it was before) 2023-04-23 11:28:09 +07:00
Alex Sharov
e1f549ff01
cli: use SplitAndTrim instead of strgings.Split(",") (#7369) 2023-04-23 10:54:55 +07:00
Alex Sharov
d7d7af3b86
p2p: reduce verbosity of NetworkIdMissmatchErr and EOF (because likely we can't do anything about it and user can't) (#7368) 2023-04-23 10:41:46 +07:00
rekyyang
d6986ad6d3
trace_filter: support Mode == intersection (#7345) 2023-04-21 09:28:42 +07:00
alexqrid
db51dd5f02
trace_block: add new gasBailOut parameter to request (default: false) (#7326)
**Problem**
While tracing the block with Parity tracer(`trace_block`) it returns
error for a few blocks.
<details><summary>Example of blocks that couldn't be traced</summary>

These are the example of payloads with the errors occured during tracing
the blocks:
1. `{"method":"trace_block","params":["0x24165bd"],"id":0}` - `first run
for txIndex 32 error: insufficient funds for gas * price + value:
address 0x000005D814d5abD6e0F9345c9b1f37C82Eaf1EBb have
547961731687102852 want 675024999764675175`
2. `{"method":"trace_block","params":["0x2658753"],"id":0}` - `first run
for txIndex 45 error: insufficient funds for gas * price + value:
address 0x000004BeDC012a5D043270AF67de24c20a3b8aeB have
211658993830905595 want 235579381558610848`
3. `{"method":"trace_block","params":["0x258b00c"],"id":0} -first run
for txIndex 274 error: insufficient funds for gas * price + value:
address 0xA3a762006D22806B35895f4C0599bAe3adF1B349 have
342048586356638524 want 386865441635818752`

</details>

After looking through the
[trace_filtering.go](https://github.com/ledgerwatch/erigon/blob/devel/cmd/rpcdaemon/commands/trace_filtering.go#L1006)
and
[trace_adhoc.go](https://github.com/ledgerwatch/erigon/blob/devel/cmd/rpcdaemon/commands/trace_adhoc.go#L1072)
noticed that `doCallMany` called with `gasBailOut = true` in
[one](https://github.com/ledgerwatch/erigon/blob/devel/cmd/rpcdaemon/commands/trace_adhoc.go#L1072)
place and `gasBailOut = false` in
[another](https://github.com/ledgerwatch/erigon/blob/devel/cmd/rpcdaemon/commands/trace_filtering.go#L1006)
(actually the part of the code that is called by `trace_block`.
Changing its value to `true` fixed the problem and traces are successful
with this change.
Attaching the partial result of the successful trace below.


<details><summary>{"method":"trace_block","params":["0x24165bd"],"id":0}</summary>

```json
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": [
    {
      "action": {
        "from": "0x3eaf7de168a79c1d6a1aab8c106e42b6f4e0a7c8",
        "callType": "call",
        "gas": "0x30464",
        "input": "0x0000000100000000000000000000000000000000000000000000000000000001dcbde73f0000000000000000000000000000000000000000000002086b35cd47c9189dc02791bca1f2de4661ed88a30c99a7a9449aa841740d500b1d8e8ef31e21c99d1db9a6444d3adf12700001f4000000000000000000000f490d8e000000000000",
        "to": "0x1d36f9688cceafee9d7df45fe8e24884ed0d6730",
        "value": "0x0"
      },
      "blockHash": "0x96f0792349a67b7995dda853df79bd5fa9d2926eb2ac8a07ac46e4df429632af",
      "blockNumber": 37840317,
      "error": "Reverted",
      "result": {
        "gasUsed": "0x1d2d",
        "output": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000056572723332000000000000000000000000000000000000000000000000000000"
      },
      "subtraces": 1,
      "traceAddress": [],
      "transactionHash": "0x1417cab7ae635884117909cc828474df0121d4a2a0ad033f462e6fa84bfab176",
      "transactionPosition": 0,
      "type": "call"
    },
    {
      "action": {
        "from": "0x1d36f9688cceafee9d7df45fe8e24884ed0d6730",
        "callType": "staticcall",
        "gas": "0x2e9b7",
        "input": "0x3850c7bd",
        "to": "0xa374094527e1673a86de625aa59517c5de346d32",
        "value": "0x0"
      },
      "blockHash": "0x96f0792349a67b7995dda853df79bd5fa9d2926eb2ac8a07ac46e4df429632af",
      "blockNumber": 37840317,
      "result": {
        "gasUsed": "0xa88",
        "output": "0x000000000000000000000000000000000000000000000f49c33e3991750050fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbc158000000000000000000000000000000000000000000000000000000000000096d00000000000000000000000000000000000000000000000000000000000009c400000000000000000000000000000000000000000000000000000000000009c400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
      },
      "subtraces": 0,
      "traceAddress": [
        0
      ],
.....
      },
      "blockHash": "0x96f0792349a67b7995dda853df79bd5fa9d2926eb2ac8a07ac46e4df429632af",
      "blockNumber": 37840317,
      "result": null,
      "subtraces": 0,
      "traceAddress": [],
      "type": "reward"
    }
  ]
}

```

</details>

---------

Co-authored-by: alexqrid <>
2023-04-21 09:28:04 +07:00
Giulio rebuffo
ec8cdd4701
Refactore fork choice to RR approach (#7359) 2023-04-20 22:47:58 +02:00
Jason Yellick
7f31b047f1
Fix eth_getProof element order (#7351)
According to EIP-1186 the `proof` parts of the response to eth_getProof
should be returned "starting with the stateRoot-Node, following the path
of the SHA3 (address) as key." Currently, the proof is returned in
traversal order, rather than from the root.

Although all of the proof elements are there and correct, this is
contrary to the EIP and will cause problems for some clients. The
existing rpc test uses a map to lookup proof elements by hash, rather
than by index, so this bug was not initially caught.

This commit fixes the behavior, updates the existing test, and adds
additional checks to the rpc test.

Co-authored-by: Jason Yellick <jason@enya.ai>
2023-04-20 10:06:19 +07:00
Giulio rebuffo
f8f1658f8d
added deep copy to BeaconState copy (#7352)
Before caches were recomputed, now caches are not recomputed anymore for
BeaconStates internals
2023-04-19 22:56:24 +02:00
Giulio rebuffo
2ce5e761bb
added --internalcl flag to Erigon (#7349) 2023-04-19 14:37:35 +02:00
Alex Sharov
b23a0267d3
e3: deadlock fix part2 (#7344) 2023-04-19 08:12:13 +00:00
mars
bcfaa84b35
add api debug_getRawHeader debug_getRawBlock (#7333)
Add  json rpc api :
debug_getRawHeader
debug_getRawBlock 

doc:
 https://ethereum.github.io/execution-apis/api-documentation/
2023-04-19 08:05:45 +00:00
Alex Sharov
695b9f887b
e3: close input chan in the end of rwloop (to fix deadlock) (#7342) 2023-04-19 07:26:22 +00:00
Alex Sharov
a5b9f2d774
e3: close input chan when no work left (#7340) 2023-04-19 04:47:53 +00:00
Krishna Upadhyaya
283bd9bbef
Fix nullnull issue (#7334)
https://github.com/ledgerwatch/erigon/issues/7248
2023-04-19 01:47:19 +00:00
alex.sharov
31e5036985 save 2023-04-18 08:26:55 +07:00
Giulio rebuffo
515aedda7b
Added Caplin Phase 1 (#7290)
* Introduces full beacon validation
* Removes light client
* NOTE: slow on purpose, I want everything to be BLS verified for now.
2023-04-17 18:06:50 +00:00
Alex Sharov
69a3396433
add flag --db.size.limit (#7325) 2023-04-17 12:48:57 +00:00
Alex Sharov
6d5a16a4ab
e3: fix exec tx nil (#7322) 2023-04-17 06:42:37 +00:00
Andrew Ashikhmin
9b81302d9d
Embed AuRa config into chain Config (#7307)
Prerequisite: https://github.com/ledgerwatch/erigon-lib/pull/970
2023-04-14 07:51: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
sudeep
74ca124a62
Shanghai update for evm tool (#7304) 2023-04-13 14:55:51 +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
a
fc7f5e1693
fix nil ptr on polygon trace methods (#7265)
when assigning default bor parameters, need to make sure config exists
first. since not sending the config will result in it being nil, not the
empty struct.
2023-04-10 07:00:36 +00:00
alex.sharov
6e57f3ef92 e3: less conlicts 2023-04-10 09:38:08 +07:00
Alex Sharov
895e61d1ab
e3: merge out chan+heap to one class (#7287) 2023-04-10 02:33:20 +00:00
Russel Waters
e56793d5ea
txpool: update cli flags (#7282)
it would appear that an extra `e` was added somewhere along the way to
the cli flags for txpool. If this was intentional I was curious as to
why, otherwise it seems like fixing the flag would remedy some
confusion. Thank you

Upon further investigation it would appear
https://github.com/ledgerwatch/erigon/blob/devel/cmd/utils/flags.go#L173
shows corrected spelling.
2023-04-08 06:52:04 +00:00
Giulio rebuffo
c1cf58ef93
Added forkchoice rule (#7281)
Added fork choice rule to Erigon-CL
2023-04-08 01:01:10 +00:00
ledgerwatch
9690228ede
[Diagnostics] Simplify logging settings, introduce correct log rotation with lumberjack (#7273)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-04-07 21:08:44 +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
Andrew Ashikhmin
762b63eb14
More logging for block build requests (#7264) 2023-04-05 15:30:45 +00:00
Jason Yellick
80530e10a9
Add storage proof support to eth_getProof (#7202)
This PR completes the implementation of `eth_getProof` by adding support
for storage proofs.

Because storage proofs are potentially overlapping, the existing
strategy of simply aggregating all proofs together into a single result
was challenging. Instead, this commit rewires things to introduce a
ProofRetainer, which aggregates proofs and their corresponding nibble
encoded paths in the trie. Once all of the proofs have been aggregated,
the caller requests the proof result, which then iterates over the
aggregated proofs, placing each into the relevant proof array into the
result.

Although there are tests for `eth_getProof` as an RPC and for the new
`ProofRetainer` code, the code coverage for the proof generation over
complex tries is lacking. But, since this is not a new problem I'll plan
to follow up this PR with an additional one adding more coverage into
`turbo/trie`.

---------

Co-authored-by: Jason Yellick <jason@enya.ai>
2023-04-05 03:01:31 +00:00
alex.sharov
2515b9c069 evm use shared db 2023-04-04 11:32:40 +07:00
alex.sharov
634f07ddd5 save 2023-04-04 11:32:12 +07:00
Alex Sharov
6339a3c9d1
remove lru package alias (#7251) 2023-04-04 04:02:23 +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
77fcc58400
grafana remove datasource uid (#7247) 2023-04-03 11:59:41 +00:00
Alex Sharov
65fcec8d85
e3: replace sync.Cond to fix deadlock (#7243) 2023-04-03 11:33:43 +00:00
Alex Sharov
06da707d58
e3: add metric for repeat count (#7239) 2023-04-03 04:34:45 +00:00
Alex Sharov
d3cc1e152c
switch to lruv2 (#7238) 2023-04-03 03:19:30 +00:00
Lawrence Aiello
64bdd13276
chore: update outdated grafana panels (#7232)
## Changelog

Fixed the following Grafana panels:
* DB Size
* GC and State
* DB Pages Ops/sec
* Commit Counters
* Getrusage
* Latest Block

Also partially fixes https://github.com/ledgerwatch/erigon/issues/7226
2023-04-03 02:38:05 +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
Jochen Müller
97eccd913c
Some additions to the devnet tool (#7225)
- Fix tx numbers expected
- Check for baseFee subpool size too
- Fix tx counting
- Wait for blocks in baseFee subpool to be promoted and mined
- Add BlockNumber request
2023-03-30 21:49:28 +00:00
ledgerwatch
fac796d921
Diagnostics - step 2 (#7214)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-03-30 20:59:03 +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