erigon-pulse/turbo
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
..
adapter ChainId conditional in Legacy transaction (#5856) 2022-11-18 03:15:32 +03:00
app Downloader extract, step2 (#6076) 2022-11-20 10:41:30 +07:00
builder Withdrawals part 1 (#6009) 2022-12-01 09:15:01 +01:00
cli Downloader extract, step2 (#6076) 2022-11-20 10:41:30 +07:00
cmdtest move all packages from "internal" folder - to simplify users live (#5857) 2022-10-25 09:58:25 +07:00
debug e3: optimize incremental hashstate (#6179) 2022-12-03 12:23:01 +07:00
engineapi Create in-memory MDBX inside dirs.Tmp (#5702) 2022-10-11 16:49:38 +01:00
logging Upgrade urfave/cli to v2 (#6047) 2022-11-14 17:33:57 +01:00
mock rpcdaemon: add txpool_status() (#2407) 2021-08-06 09:45:44 +07:00
node Upgrade urfave/cli to v2 (#6047) 2022-11-14 17:33:57 +01:00
rlphacks Use go:build lines and remove obsolete +build lines (#4175) 2022-05-17 14:46:53 +07:00
rpchelper Withdrawals part 1 (#6009) 2022-12-01 09:15:01 +01:00
services Transaction count fix (#4888) 2022-08-04 18:49:53 +07:00
shards Update interfaces (#6031) 2022-11-11 17:16:39 +01:00
snapshotsync use crypto pool (#6197) 2022-12-04 11:59:02 +07:00
stages Avoiding leaking the popped item (#6193) 2022-12-04 11:17:02 +07:00
testlog move all packages from "internal" folder - to simplify users live (#5857) 2022-10-25 09:58:25 +07:00
transactions Fix trace error in Polygon | Pass Engin to the Base API (#6131) 2022-12-04 12:17:39 +07:00
trie updated go-verkle (#6126) 2022-11-26 19:36:10 +01:00
README.md Rename to Erigon (#2018) 2021-05-26 11:35:39 +01:00

Erigon-API

Erigon-API is a set of tools for building applications containing Erigon node.

Our own binary erigon is built using it.

Modules

  • cli - erigon-cli, methods & helpers to run a CLI app with Erigon node.

  • node - represents an Ethereum node, running devp2p and sync and writing state to the database.

  • stagedsync - staged sync algorithm.

Examples

  • erigon - our binary is using erigon-api with all defaults

  • erigoncustom - a very simple example of adding a custom stage, a custom bucket and a custom command-line parameter

  • erigon-examples - a series of examples for Erigon api