Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add few integration tests #2

Merged
merged 11 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 23 additions & 67 deletions integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,87 +42,43 @@ Launch an automated test sequence on Silkworm RpcDaemon (aka Silkrpc) or Erigon
-d send requests also to the reference daemon i.e. Erigon RpcDaemon
-i <infura_url> send any request also to the Infura API endpoint as reference
-b blockchain [default: goerly]
-v verbose
-v <verbose_level>
-o dump response
-k authentication token file
-x exclude API list (i.e txpool_content,txpool_status,engine_
-X exclude test list (i.e 18,22
-x exclude API list (i.e. txpool_content,txpool_status,engine_
-X exclude test list (i.e. 18,22
-H host where the RpcDaemon is located (e.g. 10.10.2.3)
-p port where the RpcDaemon is located (e.g. 8545)

```

# Integration test (11/08/23)
# erigon/rpcdaemon version 2.48.1
# Invoke examples

### To run integration tests comparing results with json file: ./run_tests.py -c -k jwt.hex
### (in case Erigon without snapshot & KV access to DB & Rpcdaemon embedded)
% ./run_tests.py -b mainnet -d -c -v 1

```
Test time-elapsed (secs): 77
Number of executed tests: 448/450
Number of NOT executed tests: 0
Number of success tests: 448
Number of failed tests: 0
```
Runs all tests on main net chain comparing silkrpc response with rpcdaemon response, printing each test result

% ./run_tests.py -b mainnet -c -v 1

### To run integration tests comparing results with RPCdaemon response (KV) : ./run_tests.py -f -d -c -k jwt.hex
### (in case Erigon without snapshot & KV access to DB comparing results with RPCDaemon KV, Rpcdaemon embedded)
```
091. erigon_forks/test_1.json Failed
351. trace_filter/test_06.tar Failed
352. trace_filter/test_07.tar Failed

Test time-elapsed (secs): 90
Number of executed tests: 424/461
Number of NOT executed tests: 0
Number of success tests: 421
Number of failed tests: 3
Runs all tests on main net chain comparing silkrpc response to response saved on json file, printing each test result

```
% ./run_tests.py -b mainnet -c -a eth_call

### To run integration tests comparing results with RPCdaemon response (KV) : ./run_tests.py -f -d -c -k jwt.hex
### (in case Erigon with snapshot & KV access to DB comparing results with RPCDaemon KV & Rpcdaemon embedded)
```
091. erigon_forks/test_1.json Failed
351. trace_filter/test_06.tar Failed
352. trace_filter/test_07.tar Failed

Test time-elapsed (secs): 90
Number of executed tests: 424/461
Number of NOT executed tests: 0
Number of success tests: 421
Number of failed tests: 3
Runs all tests of eth_call on main net chain comparing silkrpc response with saved json file, printing only failed tests

```
% ./run_tests.py -b mainnet -r -c -a eth_call -t 1

Runs test 1 of eth_call on main net chain comparing rpcdaemon response to saved json file, printing only failed tests

### To run integration tests comparing results with local DB: ./run_tests.py -f -d -c -k jwt.hex
### (in case Erigon without snapshot & local access to DB comparing results with RPCDaemon)
```
091. erigon_forks/test_1.json Failed
097. erigon_getBlockByTimestamp/test_1.json Failed
351. trace_filter/test_06.tar Failed
352. trace_filter/test_07.tar Failed

Test time-elapsed (secs): 86
Number of executed tests: 424/461
Number of NOT executed tests: 0
Number of success tests: 420
Number of failed tests: 4
```
% ./run_tests.py -b mainnet -r -c -t 20 -v 1

Runs test number 20 in main net chain using rpcdaemon and compare result with json file, printing each test result

### To run integration tests comparing results with local DB: ./run_tests.py -f -d -c -k jwt.hex
### (in case Erigon with snapshot & local access to DB comparing results with RPCDaemon)
```
091. erigon_forks/test_1.json Failed
351. trace_filter/test_06.tar Failed
352. trace_filter/test_07.tar Failed

Test time-elapsed (secs): 89
Number of executed tests: 424/461
Number of NOT executed tests: 0
Number of success tests: 421
Number of failed tests: 3
% ./run_tests.py -b mainnet -d -c -X 20 -v 1

Runs all tests (excluding test number 20) on main net chain comparing silkrpc response with rpcdaemon response, printing each test result

% ./run_tests.py -b mainnet -d -c -x eth_call -v 1

Runs all tests (excluding eth_call tests) on main net chain comparing silkrpc response with rpcdaemon response, printing each test result

```
29 changes: 29 additions & 0 deletions integration/mainnet/eth_call/test_01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"test": {
"reference": "https://etherscan.io/tx/0x84eac3162e731088b7276cca885aa916fc5b8c11dfef13b9df2729806bbbaf57",
"description": "only eth transfer"
},
"request": {
"jsonrpc":"2.0",
"method":"eth_call",
"params":[
{
"from": "0xEF04bc7821433f080461BBAE815182E3d7bBb61A",
"to": "0x4debB0dF4da8D1f51EF67B727c3F1c0eCC7ed009",
"gas": "0x5208",
"gasPrice": "0x2CB417800",
"value": "0x229322"
},
"0x89543F"
],
"id":1
},
"response": {
"id":1,
"jsonrpc":"2.0",
"result":"0x"
}
}
]

33 changes: 33 additions & 0 deletions integration/mainnet/eth_call/test_02.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
"test": {
"reference": "https://etherscan.io/tx/0x2f89ebd51377291f39b315a5feac7cbef0c8377f512bba32b128d59b086f6abe",
"description": "invoke contract method"
},
"request": {
"jsonrpc":"2.0",
"method":"eth_call",
"params":[
{
"data": "0xf242432a000000000000000000000000d3181ddbb2cea7b4954b8d4a05dbf85d8fc36aef000000000000000000000000e44249550d8a03737f185e054a686e55577f38400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000",
"from": "0xd3181ddbB2CEA7B4954b8D4a05DBf85D8Fc36aef",
"to" : "0xe3782B8688ad2b0D5ba42842d400F7AdF310F88d",
"gas": "0xDDD2",
"gasPrice": "0x2098A67800",
"value": "0x0"
},
"0xD59F7F"
],
"id":1
},
"response": {
"id":1,
"jsonrpc":"2.0",
"error": {
"code": -32000,
"message": "fee cap less than block base fee: address 0xd3181ddbb2cea7b4954b8d4a05dbf85d8fc36aef, gasfeecap: 140000000000 basefee: 146283608928"
}
}
}
]

Loading