Commit Graph

497 Commits

Author SHA1 Message Date
Enrique Jose Avila Asapche
a0da31bb1d
Transaction count fix (#4888)
* getBlockTransactionCountByHash using snapshots

* got body from block reader

* requesting block body with transactions

* tests

* added tx amount into blocreader body

* using txAmount from body
2022-08-04 18:49:53 +07:00
hexoscott
c61fbff74c
fix eth gas estimate when no pending block is available (#4898) 2022-08-04 11:47:11 +01:00
Enrique Jose Avila Asapche
0908536e0a
check if eip-1559 (#4927) 2022-08-04 12:30:20 +03:00
Leonard Chinonso
ec67e80a8a
Fixed lint errors for gocritic linter (#4904) 2022-08-03 00:35:22 +07:00
Leonard Chinonso
808df67683
Fixed lint errors for staticcheck (#4901) 2022-08-02 21:07:39 +07:00
Henry
9ed2f8d98b
cmd:use for_range read channel (#4880) 2022-08-01 12:58:09 +07:00
nanevardanyan
de0471aace
cmd: separate auth rpc server from regular (#4822)
* WIP: cmd: separate auth rpc server from regular

* WIP: cmd: updates after code review

* WIP: cmd: eth and engine should be predefined values for authAPI

* cmd: http enabled flag should not affect admin

* cmd: eliminate engine checks in case of non-auth

* cmd: remove engine from http.api options
2022-07-31 12:16:19 +02:00
Alex Sharov
a862bd9913
Revert "fix streaming in error case (#4861)" (#4862)
This reverts commit deccbf973a.
2022-07-29 16:59:31 +07:00
Alex Sharov
deccbf973a
fix streaming in error case (#4861)
* save

* save
2022-07-29 11:08:04 +07:00
Enrique Jose Avila Asapche
8b1574127a
checking txn chain id before adding it to the tx pool (#4855) 2022-07-29 08:26:15 +07:00
Giulio rebuffo
039b661803
fixed timeout on CL (#4836)
* fixed timeout

* send response immediately wen dealing with SYNCING

* send response immediately wen dealing with SYNCING

* correct lvh for ACCEPTED

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-07-27 09:16:26 +02:00
Andrew Ashikhmin
c1f848746d
Update consensus tests to v11 (#4724)
* Consensus tests update 11

* Add GrayGlacier fork

* Wire currentRandom from tests into PREVRANDAO

* Serenity engine

* Support insertion of PoS blocks in MockSentry

* Introduce marshallTypedTransactionsAsRlpStrings arg into (*Block) RawBody()

* Revert "Introduce marshallTypedTransactionsAsRlpStrings arg into (*Block) RawBody()"

This reverts commit 903fca572be03c7de33318ce177a03a4be34927b.

* Post-merge fix

* Don't wait for Beacon Chain in tests

* Skip powToPosBlockRejection transition test

* ForkChoice in insertPoSBlocks

* Add withPosDownloader arg to MockWithEverything in order to fix TestPoSDownloader
2022-07-26 09:35:38 +02:00
ledgerwatch
6f53d1ef4d
Fix test compilation error (#4809)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-07-24 10:44:52 +01:00
bgelb
6481757175
fix regressions in trace_call and eth_createAccessList introduced by PR #3517 (#4807) 2022-07-24 09:50:43 +01:00
dmitriyselivanov
e85796a38c
rpcdaemon: added test for eth_call in case of a pruned block (#4776) 2022-07-24 09:50:00 +01:00
banteg
1533bea3f6
fix(vmtrace): missing pushes (#4808)
* fix(vmtrace): add chainid stack value

* fix(vmtrace): add coinbase stack value
2022-07-24 08:56:37 +01:00
banteg
4c0ab19bc6
fix(vmtrace): return value pushed by smod (#4806) 2022-07-24 12:21:31 +07:00
Giulio rebuffo
1cb6be02a5
Avoid constantly triggering stageloop when using Engine API (#4797)
* avoid constantly triggering stageloop when using Engine API

* fix lint + test

* fixed comments

* ops

* little fixes here and there

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-07-23 18:57:23 +02:00
Levi Aul
b6440eea1e
Add erigon_getBalanceChangesInBlock RPC endpoint (#4609)
* Add eth_getBalanceChangesInBlock RPC endpoint

* Fix lints

* added assertion for one test

* moved balance change api from eth to erigon

Co-authored-by: fatemebagherii <fa.bagheri.a@gmail.com>
2022-07-15 16:04:23 +02:00
Max Revitt
e8f83db208
Gas api unit tests (#4715)
* gas price initial unit tests

* tweak(makefile): gas price test timeout increase

increase test timeout in Makefile to 50s from 30s
to cater for increased test time unit testing
gas price logic.

Co-authored-by: Scott Fairclough <scott@hexosoft.co.uk>
2022-07-15 14:56:35 +02:00
Leonard Chinonso
8a75033b98
returned error if error object is not nil (#4685)
* returned error if error object is not nil

* undefined block: changed it to blockNumber
2022-07-10 08:13:24 +06:00
Leonard Chinonso
cfc051892e
Fix for issue 4205 (optimize eth_getLogs) (#4662)
* optimize eth_getLogs

* used the implementation from api._blockReader

* used the implementation from api._blockReader
2022-07-09 19:42:57 +06:00
Levi Aul
8de866028a
Additional bor RPC fixes (#4675)
* Add borTx to GetBlockByHash; ensure borTxs have hashes; don't try to derive sender for borTxs

* Surface borReceipt logs in eth_getLogs

* Check for existence of borReceipt before synthesizing a borTx
2022-07-09 09:15:22 +06:00
Andrew Ashikhmin
225935b376
Bump log level of some PoS messages from Trace to Debug (#4682) 2022-07-08 15:18:36 +02:00
sudeep
e13a318e0b
evm t8n to use ExecuteBlockEphemerally api (#4642)
* evm t8n tool to use ExecuteBlockEphemerally api (#4512)

* fix to set V, R, S in legacy transaction

* fix to dump post-execution alloc for evm t8n

* close tx in evm t8n

* populate current difficulty and gas used in output result

- update the ExecutionResult to include corresponding info (like
  Difficulty/GasUsed)

* initial attempt at migrating 'evm t8n' to use ExecuteBlockEphemerally

* using ExecutionResult in ExecuteBlockEphemerally

* bypass validations and integrate with EphemeralExecResult

* fixing output of 'evm t8n'

- remaining bits are "stateRoot" in results.txt and "balance" field for one account in
  alloc.txt (for testdata=1)

* get ExecuteBlockEphemerally to accept getTracer lambda

* fix build failure

* test cases for evm t8n

* more test cases for evm t8n

* fix stateRoot computation in evm t8n

* remove reward argument, as EBE itself takes care of it

* final cleanups for migration to using ExecuteBlockEphemerally

* change EBEforBSC to match EBE

* fix linter issues

* manually revert an unwanted diff

* avoid calculating ReceiptHash twice

* linter check

* minor correction

* remove unnecessary logic in EBEforBsc

* fix integration tests

* fix build
2022-07-07 12:47:00 +01:00
Levi Aul
7b80744768
Ensure (fake) Bor txs + receipts are returned from all relevant RPC methods (#4663)
* Ensure fake Bor txs + receipts are returned from all relevant RPC methods

* Add rest of bor implementation for eth_getBlockByNumber

* Use TxLookup index to find Bor txs

* Fix txHash on emitted borTxs and borReceipts

* Fix checks given that borTxs get registered in TxLookup; remove useless ref indirections
2022-07-07 14:40:50 +06:00
Alex Sharov
d9cb87a149
RPC: Enable back json streaming for non-batch and non-websocket cases (#4647)
* enable rpc streaming

* enable rpc streaming
2022-07-06 11:44:06 +01:00
Alex Sharov
7e2d46cbe4
Support "latests block number" in Oracle Backend (#4635)
* save

* save

* save

* save

* save

* save

* save

* save
2022-07-05 14:49:39 +06:00
Giulio rebuffo
b980280785
Fixed hive test on invalid transition payload (#4618)
* experiment #1

* experiment #2

* experiment #3

* experiment 4
2022-07-03 17:36:39 +02:00
Giulio rebuffo
c422b8c4da
better ancestor check (#4617) 2022-07-03 13:34:35 +02:00
Giulio rebuffo
3fc51f5ef7
Revert "Proper Pos block checker when INVALID/ACCEPTED status is sent (#4604)" (#4616)
This reverts commit e90e03ae31.
2022-07-03 13:11:16 +02:00
Giulio rebuffo
e90e03ae31
Proper Pos block checker when INVALID/ACCEPTED status is sent (#4604)
* added proper PoS block checker

* proper invalid lvh

* p

* fixed smol thingy

* fix more

* fixed engine API

* fixed engine API

* better nil hash

* added 0x0 checks

* full support
2022-07-03 11:58:57 +02:00
ledgerwatch
77dc35bb85
Revert "evm t8n tool to use ExecuteBlockEphemerally api (#4512)" (#4610)
* Revert "evm t8n tool to use ExecuteBlockEphemerally api (#4512)"

This reverts commit db93d2ea37.

* Fix compilation

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-07-02 23:24:20 +01:00
sudeep
db93d2ea37
evm t8n tool to use ExecuteBlockEphemerally api (#4512)
* fix to set V, R, S in legacy transaction

* fix to dump post-execution alloc for evm t8n

* close tx in evm t8n

* populate current difficulty and gas used in output result

- update the ExecutionResult to include corresponding info (like
  Difficulty/GasUsed)

* initial attempt at migrating 'evm t8n' to use ExecuteBlockEphemerally

* using ExecutionResult in ExecuteBlockEphemerally

* bypass validations and integrate with EphemeralExecResult

* fixing output of 'evm t8n'

- remaining bits are "stateRoot" in results.txt and "balance" field for one account in
  alloc.txt (for testdata=1)

* get ExecuteBlockEphemerally to accept getTracer lambda

* fix build failure

* test cases for evm t8n

* more test cases for evm t8n

* fix stateRoot computation in evm t8n

* remove reward argument, as EBE itself takes care of it

* final cleanups for migration to using ExecuteBlockEphemerally

* change EBEforBSC to match EBE

* fix linter issues

* manually revert an unwanted diff

* avoid calculating ReceiptHash twice

* linter check

* minor correction

* remove unnecessary logic in EBEforBsc
2022-07-02 06:52:23 +01:00
Enrique Jose Avila Asapche
975bf0ecb9
Changing rawdb to blockReader (#4602) 2022-07-01 17:36:44 +03:00
Enrique Jose Avila Asapche
057fb3f4b0
More tests (#4591)
* check if we have TD

* some test

* fixed pending test

* all test

* reverting initial commit

* checking for td again
2022-07-01 12:12:01 +01:00
primal_concrete_sledge
5a8c729fbb
fix/Issue-4593_remove_double_close_of_newheads_chan (#4598) 2022-07-01 10:51:42 +01:00
Enrique Jose Avila Asapche
fa2998728a
pending block will only return if it is not nil (#4588)
* pending block will only return if it is not nil

* unncessary
2022-07-01 10:08:13 +06:00
battlmonstr
a5c1cad346
Fix eth_subscribe_test timeout on CI (#4595)
Reduce the likelihood of a deadlock caused by goroutine starvation on CI.
The CI macOS runners have 3 cores.
When running other tests in parallel having too few available cores could cause a deadlock.

Test with:

GOMAXPROCS=2 go test ./cmd/rpcdaemon/commands/eth_subscribe_test.go -test.count 100 --timeout 10s

Expected: the command finishes within 3 sec
Before the fix: it timeouts (without a timeout - hangs forever)
2022-07-01 09:03:29 +06:00
Enrique Jose Avila Asapche
5013be0075
getting header instead of block (#4582) 2022-06-30 10:46:25 +01:00
Enrique Jose Avila Asapche
d72fba3bec
eth_estimateGas: read header instead of whole block (#4561)
* check if block is nil

* using read header

* returning 0, nil
2022-06-29 17:29:31 +03:00
hrthaowang
479912423e
Introduce eth_callMany and debug_traceCallMany (#4567)
* rpc: add eth_callMany (#1)

* clean the repo

* clean style

* remove unwanted err check

* fix header bug

* Add RPC `debug_traceCallMany` (#4)

* update submodule

* fix error msg
2022-06-29 14:24:21 +01:00
Alex Sharov
880a339456
gen less blocks in test (#4571) 2022-06-29 13:22:47 +06:00
Andrew Ashikhmin
dc5d3ffaac
Revert "Switch from eth/66 to eth/67 (#4549)" (#4562)
This reverts commit 16e57aa8a2.
2022-06-28 13:42:35 +02:00
Andrew Ashikhmin
16e57aa8a2
Switch from eth/66 to eth/67 (#4549)
* Switch from eth/66 to eth/67

* Fix a compilation error

* Update erigon-lib

* Refresh erigon-lib
2022-06-28 10:12:48 +02:00
Alex Sharov
b315394c48
eth_estimateGas to use snapshots and blocksLRU (#4556) 2022-06-28 13:56:08 +06:00
Enrique Jose Avila Asapche
389af4fc06
check if block is nil (#4528)
* check if block is nil

* added to rpcdaemon22
2022-06-24 19:48:40 +06:00
primal_concrete_sledge
5e2f6bb2db
Fix/new eth filters (#4504)
* Add fixes to eth_newPendingTxFilter and others

* Fix tests

* Add test

* Add goroutines return on closed chans
2022-06-24 09:11:38 +01:00
ledgerwatch
e44d62db1a
Fix trace block (#4480)
* Fix trace block

* Fix compile

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-17 19:14:52 +01:00
ledgerwatch
93151f0ae6
[erigon2.2] Reduce allocations when replaying historical txs (#4460)
* [erigon2.2] Reduce allocations when replaying historical txs

* import new API, fix code

* Add hack decompress function

* update erigon-lib

* Fix hack

* Update to latest erigon-lib

* Fix reindexing

* Enable skip analysis for tracing calls too

* Enable for eth_getLogs

* Fix skip analysis

* Optimise

* Stop grpc server in the tests

* Print

* No panic on server stop

* Update to latest erigon-lib

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-17 13:40:49 +01:00