Skip to content

Commit

Permalink
Merge pull request #1867 from lavanet/PRT-add-trace-to-ethereum
Browse files Browse the repository at this point in the history
feat: PRT - adding trace methods to ethereum
  • Loading branch information
omerlavanet authored Dec 25, 2024
2 parents c40cc9b + a7db023 commit b1453a2
Show file tree
Hide file tree
Showing 2 changed files with 220 additions and 4 deletions.
211 changes: 211 additions & 0 deletions specs/mainnet-1/specs/ethereum.json
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,217 @@
}
],
"extensions": []
},
{
"enabled": true,
"collection_data": {
"api_interface": "jsonrpc",
"internal_path": "",
"type": "POST",
"add_on": "trace"
},
"apis": [
{
"name": "trace_call",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 200,
"enabled": true,
"category": {
"deterministic": false,
"local": true,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "trace_block",
"block_parsing": {
"parser_arg": [
"0"
],
"parser_func": "PARSE_BY_ARG"
},
"compute_units": 200,
"enabled": true,
"category": {
"deterministic": false,
"local": true,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0,
"parsers": [
{
"parse_path": ".params.[0]",
"parse_type": "BLOCK_LATEST"
}
]
},
{
"name": "trace_get",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 200,
"enabled": true,
"category": {
"deterministic": false,
"local": true,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "trace_filter",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 200,
"enabled": true,
"category": {
"deterministic": false,
"local": true,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0,
"parsers": [
{
"parse_path": ".params.[0].fromBlock",
"parse_type": "BLOCK_EARLIEST"
},
{
"parse_path": ".params.[0].toBlock",
"parse_type": "BLOCK_LATEST"
}
]
},
{
"name": "trace_transaction",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 200,
"enabled": true,
"category": {
"deterministic": false,
"local": true,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0,
"parsers": [
{
"parse_path": ".params.[0]",
"parse_type": "BLOCK_HASH"
}
]
},
{
"name": "trace_rawTransaction",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 200,
"enabled": true,
"category": {
"deterministic": false,
"local": true,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "trace_replayBlockTransactions",
"block_parsing": {
"parser_arg": [
"0"
],
"parser_func": "PARSE_BY_ARG"
},
"compute_units": 500,
"enabled": true,
"category": {
"deterministic": false,
"local": true,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0,
"parsers": [
{
"parse_path": ".params.[0]",
"parse_type": "BLOCK_LATEST"
}
]
},
{
"name": "trace_replayTransaction",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 200,
"enabled": true,
"category": {
"deterministic": false,
"local": true,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0,
"parsers": [
{
"parse_path": ".params.[0]",
"parse_type": "BLOCK_HASH"
}
]
}
],
"verifications": [
{
"name": "trace",
"parse_directive": {
"function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"trace_block\",\"params\":[\"latest\"],\"id\":1}",
"function_tag": "VERIFICATION",
"result_parsing": {
"parser_arg": [
"0"
],
"parser_func": "PARSE_BY_ARG"
},
"api_name": "trace_block"
},
"values": [
{
"expected_value": "*"
}
]
}
],
"extensions": []
}
]
},
Expand Down
13 changes: 9 additions & 4 deletions testutil/e2e/protocolE2E.go
Original file line number Diff line number Diff line change
Expand Up @@ -1499,18 +1499,23 @@ func runProtocolE2E(timeout time.Duration) {

// ETH1 flow
lt.startJSONRPCProxy(ctx)
lt.checkJSONRPCConsumer("http://127.0.0.1:1111", time.Minute*2, "JSONRPCProxy OK") // checks proxy.
// checks proxy.
lt.checkJSONRPCConsumer("http://127.0.0.1:1111", time.Minute*2, "JSONRPCProxy OK")

// Start json provider
lt.startJSONRPCProvider(ctx)
lt.startJSONRPCConsumer(ctx)
// Start Lava provider
lt.startLavaProviders(ctx)
// Wait for providers to finish adding all chain routers.
time.Sleep(time.Second * 7)

lt.startJSONRPCConsumer(ctx)
repeat(1, func(n int) {
url := fmt.Sprintf("http://127.0.0.1:333%d", n)
msg := fmt.Sprintf("JSONRPCConsumer%d OK", n)
lt.checkJSONRPCConsumer(url, time.Minute*2, msg)
})

// Lava Flow
lt.startLavaProviders(ctx)
lt.startLavaConsumer(ctx)

runChecksAndTests := func() {
Expand Down

0 comments on commit b1453a2

Please sign in to comment.