Commit Graph

824 Commits

Author SHA1 Message Date
formatting
7fee016cf4
Fix eth_getBlockByNumber and eth_getTransactionReceipt some bugs for polygon (#6319)
Get bor state sync tx and receipt has some error:

```
Reqeust:
curl -X "POST" "{{polygon_rpc_endpoint}}" -H 'Content-Type: application/json; charset=utf-8' -d $'{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getTransactionByHash",
  "params": [
    "0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad"
  ]
}'

Response:
{"jsonrpc":"2.0","id":1,"result":null}
```

```
Reqeust:
curl -X "POST" "{{polygon_rpc_endpoint}}" -H 'Content-Type: application/json; charset=utf-8' -d $'{
  "id": 1,
  "method": "eth_getTransactionReceipt",
  "jsonrpc": "2.0",
  "params": [
    "0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad"
  ]
}'

Response
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"EOF"}}
```


fixed:

```
Request:
curl -X "POST" "{{polygon_rpc_endpoint}}" -H 'Content-Type: application/json; charset=utf-8' -d $'{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getTransactionByHash",
  "params": [
    "0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad"
  ]
}'

Response:
{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","blockNumber":"0x1c317c0","from":"0x0000000000000000000000000000000000000000","gas":"0x0","gasPrice":"0x0","hash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","input":"0x","nonce":"0x0","to":"0x0000000000000000000000000000000000000000","transactionIndex":"0x89","value":"0x0","type":"0x0","chainId":"0x89","v":"0x0","r":"0x0","s":"0x0"}}
```

```
curl -X "POST" "{{polygon_rpc_endpoint}}" -H 'Content-Type: application/json; charset=utf-8' -d $'{
  "id": 1,
  "method": "eth_getTransactionReceipt",
  "jsonrpc": "2.0",
  "params": [
    "0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad"
  ]
}'
{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","blockNumber":"0x1c317c0","contractAddress":null,"cumulativeGasUsed":"0x0","effectiveGasPrice":"0xd532a03e6","from":"0x0000000000000000000000000000000000000000","gasUsed":"0x0","logs":[{"address":"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000038830f36f752ed29039f441cfb543639a6e07b41"],"data":"0x000000000000000000000000000000000000000000000000009c51c4521e0000","blockNumber":"0x1c317c0","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","logIndex":"0x2ee","removed":false},{"address":"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000f93bcb6f00c1a90050a60a9f737b4cb87126b8f8"],"data":"0x000000000000000000000000000000000000000000000000006a6674f260d000","blockNumber":"0x1c317c0","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","logIndex":"0x2ef","removed":false},{"address":"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000fd1091c0e49bf1d44b4786747e034d65ab46f36e"],"data":"0x000000000000000000000000000000000000000000000000002386f26fc10000","blockNumber":"0x1c317c0","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","logIndex":"0x2f0","removed":false},{"address":"0x7f280dac515121dcda3eac69eb4c13a52392cace","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000882d04c3d8410ddf2061b3cba2c3522854316feb"],"data":"0x000000000000000000000000000000000000000000001850e2f557310490f925","blockNumber":"0x1c317c0","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","logIndex":"0x2f1","removed":false},{"address":"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000028515b56512cb168ad6e6a2428bb39cb696d8bee"],"data":"0x0000000000000000000000000000000000000000000000000058d15e17628000","blockNumber":"0x1c317c0","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","logIndex":"0x2f2","removed":false}],"logsBloom":"0x000000000100a0000000000000000000000000000040000000000000000000000000000000000020000000000000000000000000000080000000000000000800000000000000000000000008000000000800000000000000040000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000020000002000000000008000000001000000000000002000000000000000020001000040000008000000000000000000080000000000000000000000000000000","status":"0x1","to":"0x0000000000000000000000000000000000000000","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","type":"0x0"}}
```
2022-12-15 11:13:52 +00:00
Enrique Jose Avila Asapche
941a228ec9
fixed tx index being empty (#6316)
#6309
2022-12-15 09:53:14 +07:00
Igor Mandrigin
94d12a5d3c
fix debug_traceBlock* methods for Gnosis Chain (#6312) 2022-12-14 16:06:24 +01:00
Enrique Jose Avila Asapche
287a3d1d6c
added erigon_GetBlockReceiptsByBlockHash (#6292)
I added a way to get canonical receipts through block hash under the
erigon name space
#6229


Tested: 
BlockHash:
0xb5d50393734894e02a94a500a5a5aade9c66f388438aeed8d7775b3b344745f1
<img width="1727" alt="Screenshot 2022-12-12 at 22 16 18"
src="https://user-images.githubusercontent.com/19207637/207166860-436ecf26-a777-4b2f-8377-22acec732486.png">
2022-12-13 20:41:51 +00:00
Changyoung Koh
27ec4f02d7
Fix Trace RPCs for Bor Transactions (#6288)
FIrst of all, thanks in advance for your advice.

I've found that `trace_replayTransaction` is having trouble tracing some
Polygon State Sync transactions such as
[`0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131`](https://polygonscan.com/tx/0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131),
just like [the case of the previous PR][p].

[p]: https://github.com/ledgerwatch/erigon/pull/6286

```shell
$ curl -XPOST 'http://localhost:8545' \
      -H 'Content-Type: application/json' \
     --data '{"method":"trace_replayTransaction","params":["0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131",["trace","stateDiff"]],"id":1,"jsonrpc":"2.0"}'
{"jsonrpc":"2.0","id":1,"result":null}
```

This is because RPCDaemon doesn't query for blocks by Bor Hash, even
though `api.txnLookup` has failed. Same as #6286.
2022-12-12 16:39:17 +00:00
Changyoung Koh
72de9410d7
Fix eth_getTransactionReceipt for Bor Transactions (#6289)
Same as #6286 and #6288

This patch closes #6276 

```shell
$ curl -XPOST 'http://localhost:8545' \
     -H 'Content-Type: application/json' \
     --data '{"method":"eth_getTransactionReceipt","params":["0x31ce15ce9a1ff347f4204a1ed3625861165c53ae08743c1f36a32865c62744c6"],"id":1,"jsonrpc":"2.0"}'
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"block has less receipts than expected: 0 \u003c= 0, block: 36635776"}}
```

cc. @0xKrishna
2022-12-12 15:21:30 +00:00
Changyoung Koh
4c02fef323
Fix eth_getTransactionByHash for Bor Transactions (#6286)
FIrst of all, thanks in advance for your advice.

I've found that `eth_getTransactionByHash` is having trouble retrieving
some Polygon State Sync transactions such as
[`0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131`](https://polygonscan.com/tx/0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131),
while `eth_getBlockByNumber` can retrieve them without problem.

```shell
$ curl -XPOST 'http://localhost:8545' \
     -H 'Content-Type: application/json' \
     --data '{"method":"eth_getTransactionByHash","params":["0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131"],"id":1,"jsonrpc":"2.0"}'
{"jsonrpc":"2.0","id":1,"result":null}
```

This is because RPCDaemon doesn't query for blocks by Bor Hash, even
though `api.txnLookup` has failed.
2022-12-12 13:26:00 +00: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
df21079ae0
vmTrace - prevent panic at stack underflow (#6275)
Fixes https://github.com/ledgerwatch/erigon/issues/4778

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-10 22:41:14 +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
983f41790d
Fetch header correctly (including snapshots) for debug_traceCall, fix… (#6273)
… formatting when error

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

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-10 15:22:07 +00:00
ledgerwatch
3d7b36e09a
Trace block formatting fix, error handling formatting fix (#6266)
Fixes https://github.com/ledgerwatch/erigon/issues/4935

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-09 22:16:41 +00:00
Andrew Ashikhmin
7eab12d90d
Shanghai & Cancun forks should be based on timestamp (#6238) 2022-12-07 18:45:44 +01:00
Alex Sharov
c555c03bb3
e3: use ibs.Reset() in rpc-daemon (#6207) 2022-12-05 12:42:08 +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
82c7779a85
evm: txContext.gasPrice to uint256 type (#6188) 2022-12-04 11:44:50 +07:00
Håvard Anda Estensen
099fb7c627
Grow string builders (#6192)
Strings builders have a buffer (slice) that can be pre-allocated
2022-12-04 10:51:20 +07:00
Alex Sharov
0efda1f19f
trace: change type of self destruct arg to uint256 (#6189) 2022-12-03 21:43:53 +07:00
a
007234b489
allow rpcdaemon to bind to tcp (#6184)
this pr adds CLI flag to allow the rpcdaemon to bind to a TCP port.

this is very useful if one wants to maintain a remote connection with
the rpcdaemon without using websocket. This is useful because a lot of
issues come with the websocket protocol (compression, max size, etc).
TCP socket gets around these things (it is just raw json over tcp
stream)

the rpc package already supports this, it was just a matter of adding
the bind.

try `echo
'{"jsonrpc":"2.0","method":"eth_blockNumber","id":"1","params":[""]}' |
nc localhost 8548` as a basic test

to test. Subscriptions are also working (idk how to send keepalives with
netcat)

the default rpc.(*Client).Dial method does not support TCP. I have not
included that in this PR. The code for such is as follow

```
// DialTCP create a new TCP client that connects to the given endpoint.
//
// The context is used for the initial connection establishment. It does not
// affect subsequent interactions with the client.
func DialTCP(ctx context.Context, endpoint string) (*Client, error) {
	parsed, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	ans := make(chan *Client)
	errc := make(chan error)
	go func() {
		client, err := newClient(ctx, func(ctx context.Context) (ServerCodec, error) {
			conn, err := net.Dial("tcp", parsed.Host)
			if err != nil {
				return nil, err
			}
			return NewCodec(conn), nil
		})
		if err != nil {
			errc <- err
			return
		}
		ans <- client
	}()
	select {
	case err := <-errc:
		return nil, err
	case a := <-ans:
		return a, nil
	case <-ctx.Done():
		return nil, ctx.Err()
	}
}

// DialContext creates a new RPC client, just like Dial.
//
// The context is used to cancel or time out the initial connection establishment. It does
// not affect subsequent interactions with the client.
func DialContext(ctx context.Context, rawurl string) (*Client, error) {
	u, err := url.Parse(rawurl)
	if err != nil {
		return nil, err
	}
	switch u.Scheme {
	case "http", "https":
		return DialHTTP(rawurl)
	case "ws", "wss":
		return DialWebsocket(ctx, rawurl, "")
	case "tcp":
		return DialTCP(ctx, rawurl)
	case "stdio":
		return DialStdIO(ctx)
	case "":
		return DialIPC(ctx, rawurl)
	default:
		return nil, fmt.Errorf("no known transport for URL scheme %q", u.Scheme)
	}
}


```

let me know if you would like me to add this to the PR as well. the TCP
connection can then be established with `rpc.Dial("tcp://host:port")`
2022-12-03 14:22:47 +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
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
Manav Darji
80e29f29d3
sprint length and base fee denominator change for mumbai testnet (#6142)
This PR includes changes required for delhi hard fork schedule at block
`29638656` on mumbai testnet. It changes few major parameters.

1. Sprint length - the number of bor blocks post which a new validator
mines has been reduced from 64 to 16.
2. Block time - the block time which was increased earlier for some
experiments to 5 seconds has been reduced to 2 seconds (along with
backup multiplier and producer delay).
3. Base fee denominator - this fields has been increased from 8 to 16 to
smoothen the effect of EIP 1559.
2022-11-29 08:11:29 +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
alexqrid
e81c074fe6
added miner address extracting for Bor in block api response (#6080)
This PR adds correct miner address to the response of
`eth_getBlockByNumber`/`eth_getBlockByHash` API methods.

Currently miner address is returned as zero address (`0x000...000`) for
Polygon -
https://wiki.polygon.technology/docs/edge/faq/validators/#why-do-the-json-rpc-commands-eth_getblockbynumber-and-eth_getblockbyhash-not-return-the-miners-address
.
Unfortunately this behaviour confuses a lot, I've succeeded in restoring
the miner address in block related API, want this to be the default
behaviour.

Co-authored-by: alexqrid <>
2022-11-22 17:11:44 +07:00
Alex Sharov
92e6e56120
Fix test e3 (#6087) 2022-11-20 10:58:20 +07:00
Alex Sharov
8afeee56c8
Downloader extract, step2 (#6076) 2022-11-20 10:41:30 +07:00
lupin012
a442293be1
ChainId conditional in Legacy transaction (#5856)
impacted API:
     eth_getTransactionByHash()
     eth_getTransactionByNumber()
     eth_getTransactionByBlockHashAndIndex()
     eth_getTransactionByBlockNumberAndIndex()
     eth_getBlockByHash()
     eth_getBlockByNumber()

1) In case of legacy transitions the chainId field should be inserted
only if V is not 27/28.
This seems also the Geth/v1.10.23 behaviour via infura

2) In case of dynamicFee/AccessList transaction the access_list should
be inserted in the response also if empty
This is done correctly in cmd/rpcdaemon/commands/eth_api.go and NOT in
internal/ethapi/api.go
This seems also the Geth/v1.10.23 behaviour via infura
2022-11-18 03:15:32 +03:00
lupin012
8ceb1638a0
add totalDifficulty to GetBlockByTimestamp (#5827)
Added totalDifficulty to the returned response to be similar to the data
returned by eth_getBlockByNumber() or eth_getBlockByHash()
2022-11-18 03:15:00 +03:00
Enrique Jose Avila Asapche
a4b9da9bd4
fixed nil ptr err (#6035)
The from field would sometimes be nil causing an error when trying to
access it, instead changed it to be an empty address #5882
2022-11-18 02:43:22 +03:00
Nebojsa Urosevic
44f909767d
Feat: add eth_exitst endpoint (#5992)
Feat: add `eth_exists` endpoint.

By introducing this endpoint, Erigon will fully enable remote execution
for pre-EIP158 blocks.
2022-11-16 07:12:52 +03:00
Giulio rebuffo
f8916e9226
Made Lightclient default (#5813)
lightclient cl is default, for external cl, run `--externalcl`
2022-11-10 17:06:04 +00:00
hexoscott
ea1edf4a11
trace json error fix (#6014)
write trace transaction errors to json and continue
2022-11-10 15:37:16 +00:00
hexoscott
475fa08fdf
eth_gasPrice performance tweaks (#6016)
Code news up an oracle for every call so existing cache checks always
came back as 0. Moved cache up a layer and pass in via the new
`gasprice.Cache` interface. Looked at putting the oracle instance onto
the ethApi itself to re-use it that way, but the backend transaction
made it a little hard work as we can't re-use that. This seemed cleaner
but happy to take feedback.

Locally takes me from ±2.5k rps to ±43k rps so quite a difference there.
(k6 with 1000 virtual users)
2022-11-10 15:36:04 +00:00
J1ang
537ae16655
refactor: add erigon_getLatestLogs & fix typo (#5994)
refactor: add `erigon_getLatestLogs` & fix typo
2022-11-09 11:21:04 +07:00
hexoscott
12ed9d22cf
eth_estimateGas performance tweaks (#6001)
Will gain more perf improvements when the change for kvcache goes in
from erigon-lib.

Hopefully can be validated with hive? My main concern is the re-use of
the state reader, I couldn't find any manipulation of it so it looks
safe to re-use.
2022-11-08 21:48:11 +00:00
J1ang
7f9edd68aa
feat: add erigon_getLatestLogs as a new feature API. (#5875)
feat: add `erigon_getLatestLogs` as a new feature API.
1. `erigon_getLatestLogs` returns latest logs that match the filter with
`logCount` length. Implementation is similar to `erigon_getLogs` but it
uses `ReverseIterator` which makes it more efficient to fetch the latest
logs.
2022-11-08 08:35:00 +07:00
hexoscott
636586c1b5
cache state check (#5844)
draft for now to get some early feedback on approach
2022-11-07 13:04:31 +00:00
ledgerwatch
c656c6576f
Update to erigon-lib, adjust flag processing (#5973)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-11-06 11:22:12 +00:00
Max Revitt
345e668832
feat(pos download): send header request to multiple peers (#5948) 2022-11-04 09:07:46 +00:00
Willian Mitsuda
84ac1b919c
Use pooled bitmaps (#5946) 2022-11-03 12:50:16 +07:00
Willian Mitsuda
11f4978ed4
Upstream all Otterscan patches to devel (#5945)
Following our previous discussion on erigon's discord, this PR requests
to upstream all Otterscan modifications to erigon's repo.

That decision comes after getting feedback from lots of users at events
this year, and although it may introduce some friction for development,
it will make integrators life easier by having all our modifications
available out of box, e.g., dappnode users will get our RPCs since their
official packages are built from erigon repo.

I'm submitting the source-code as-is, please let me know if you think
there is a better code organization.

The current set of modifications comprises only new RPCs. There are some
proposals for extra-stages that would add new tables, but they are still
WIP and will be submitted separately in future after more testing.
2022-11-03 11:32:15 +07:00
a
ad7be30679
jsonrpc HTTP Get handler & logs topic filter with map (#5922)
this pr has two things in it

1. changed filter logs to use a map for the topics. this will speed up
queries with many topics in them. I still don't have a use case for this
though. i put is as a method of Logs, since that made sense to me, happy
to move it back out though.

2. allows json-rpc over http get request. since firefox is a great json
viewer (can search through, collapse large results) i often use it to
debug. it is also useful for sharing data with those who are less
familiar with command line / programming.
example get request:

http://rpcdaemon/?method=eth_getLogs&params=[{"fromBlock":"0xf2316b","toBlock":"0xf2316b"}]

it is based on the old jsonrpc http specification
https://www.jsonrpc.org/historical/json-rpc-over-http.html#encoded-parameters
except we also accept not base64 encoded params. since every eth rpc
request has a [], it will immediately fail validation for base64 and
attempt to use the parameters as a they are. otherwise it will attempt
to parse the rest of the payload as base64 and use that.

Co-authored-by: a <a@a.a>
Co-authored-by: gfx <86091021+gfxlabs@users.noreply.github.com>
2022-11-03 09:09:04 +07:00
net.wyman
7548755b62
fix potential deadlock in eth_filters logs event (#5912)
Like the newPendingTransaction event, the logs event also has the
potential for deadlock when unsubscribed
2022-11-01 08:59:01 +07:00
net.wyman
98420edd30
Update README.md (#5914)
the rpc_daemon README.md is out of date and miss the eth_subscribe logs
event
2022-11-01 08:56:22 +07:00
Alex Sharov
381bea5b92
e3: eth_traceTransaction implementation (#5909) 2022-10-31 12:31:38 +07:00
Andrew Ashikhmin
dd43d486f3
Enable London in AllEthashProtocolChanges (#5891)
`AllEthashProtocolChanges` should contain all the EIPs accepted by the
core developers into the Ethash consensus, including the
[London](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/london.md)
protocol upgrade.
2022-10-28 17:19:18 +02:00
Andrew Ashikhmin
f46300e37e
core/vm: Rename SHA3 instruction to KECCAK256 (#5890)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/23976

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
2022-10-28 13:38:34 +02:00