Commit Graph

17979 Commits

Author SHA1 Message Date
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
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
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
b23a0267d3
e3: deadlock fix part2 (#7344) 2023-04-19 08:12:13 +00:00
alex.sharov
594949b0fe Merge branch 'e3_close_input_chan' into devel 2023-04-19 15:10:37 +07: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
9b0d9700dd save 2023-04-19 14:23:29 +07:00
alex.sharov
f3e50fc91a save 2023-04-19 13:24:05 +07:00
alex.sharov
1fb3b6f574 cumulative index stage: ctrl+C support 2023-04-19 13:14:07 +07:00
alex.sharov
d5a06a2d4f cumulative index stage: ctrl+C support 2023-04-19 13:02:42 +07:00
alex.sharov
b8a02642e2 save 2023-04-19 13:01:21 +07:00
alex.sharov
e308cfbdf8 save 2023-04-19 13:00:13 +07:00
alex.sharov
8a7f9b5163 save 2023-04-19 12:57:22 +07:00
alex.sharov
b2f5bbbff9 save 2023-04-19 12:55:10 +07:00
alex.sharov
c0cf958215 save 2023-04-19 12:52:51 +07:00
alex.sharov
279bc6063b save 2023-04-19 12:50:35 +07:00
alex.sharov
6e5e5e026c save 2023-04-19 12:46:40 +07:00
alex.sharov
132cc8854f save 2023-04-19 12:46:16 +07:00
alex.sharov
b91640b1bf save 2023-04-19 12:42:32 +07:00
alex.sharov
224cf6c513 save 2023-04-19 12:41:46 +07:00
alex.sharov
6ed147b327 save 2023-04-19 12:41:22 +07:00
alex.sharov
f7bbbb765f save 2023-04-19 12:32:31 +07:00
alex.sharov
b8d974028d save 2023-04-19 12:27:36 +07:00
alex.sharov
ff3e6e629b save 2023-04-19 12:26:32 +07:00
alex.sharov
93d594cc8a save 2023-04-19 12:25:27 +07:00
alex.sharov
04a4b1ed56 save 2023-04-19 12:22:53 +07:00
alex.sharov
94770020ec save 2023-04-19 12:19:20 +07:00
alex.sharov
3b66aa0571 save 2023-04-19 12:12:51 +07:00
Alex Sharov
a5b9f2d774
e3: close input chan when no work left (#7340) 2023-04-19 04:47:53 +00:00
alex.sharov
72502e18f0 save 2023-04-19 11:46:50 +07:00
alex.sharov
c733596f59 cumulative index stage: ctrl+C support 2023-04-19 10:56: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
Krishna Upadhyaya
283bd9bbef
Fix nullnull issue (#7334)
https://github.com/ledgerwatch/erigon/issues/7248
2023-04-19 01:47:19 +00:00
Andrew Ashikhmin
3f60a902d4
Fix nil withdrawals in eth_getBlockByHash (#7332) 2023-04-18 11:23:22 +00:00
Andrew Ashikhmin
cd25c09463
Support AuRaStep & AuRaSeal in genesis JSON (#7331) 2023-04-18 08:43:51 +00:00
alex.sharov
ebb4a054cd relax firewall rule 2023-04-18 13:45:21 +07:00
Alex Sharov
776b780ac6
e3: move staticFilesInRange method to ctx (#7330) 2023-04-18 06:04:46 +00:00
Alex Sharov
558f5bdfdd
e3: less use testTx method, more sentryMock (to support e4) (#7329) 2023-04-18 04:15:01 +00:00
alex.sharov
ef73159657 save 2023-04-18 08:30:27 +07:00
alex.sharov
31e5036985 save 2023-04-18 08:26:55 +07:00