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

feat(jsonrpc/trace): add creationMethod for parity traces #12557

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/qa-rpc-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Checkout RPC Tests Repository & Install Requirements
run: |
rm -rf ${{ runner.workspace }}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v1.22.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch feature/add_creationMethod_for_parity_traces https://github.com/jsvisa/erigon-rpc-tests ${{runner.workspace}}/rpc-tests
cd ${{ runner.workspace }}/rpc-tests
pip3 install -r requirements.txt

Expand Down
1 change: 1 addition & 0 deletions turbo/jsonrpc/gen_traces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ func TestGeneratedTraceApiCollision(t *testing.T) {
{
"action": {
"from": "0x000000000000000000000000000000000000bbbb",
"creationMethod": "create2",
"gas": "0xb49d",
"init": "0x600360035560046004556158ff6000526002601ef3",
"value": "0x0"
Expand Down
1 change: 1 addition & 0 deletions turbo/jsonrpc/trace_adhoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ func (ot *OeTracer) captureStartOrEnter(deep bool, typ vm.OpCode, from libcommon
if create {
action := CreateTraceAction{}
action.From = from
action.CreationMethod = strings.ToLower(typ.String())
action.Gas.ToInt().SetUint64(gas)
action.Init = libcommon.CopyBytes(input)
action.Value.ToInt().Set(value.ToBig())
Expand Down
9 changes: 5 additions & 4 deletions turbo/jsonrpc/trace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ type CallTraceAction struct {
}

type CreateTraceAction struct {
From common.Address `json:"from"`
Gas hexutil.Big `json:"gas"`
Init hexutility.Bytes `json:"init"`
Value hexutil.Big `json:"value"`
From common.Address `json:"from"`
CreationMethod string `json:"creationMethod"`
Gas hexutil.Big `json:"gas"`
Init hexutility.Bytes `json:"init"`
Value hexutil.Big `json:"value"`
}

type SuicideTraceAction struct {
Expand Down
Loading