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

ignore STOP debug frame #202

Merged
merged 5 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@subsquid/evm-processor",
"comment": "ignore STOP debug frame",
"type": "patch"
}
],
"packageName": "@subsquid/evm-processor"
}
3 changes: 3 additions & 0 deletions evm/evm-processor/src/ds-rpc/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@ function* mapDebugFrame(transactionIndex: number, debugFrameResult: rpc.DebugFra
}
}
break
case 'STOP':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we have a possibility of

  • gaps in trace indexes/addresses
  • children with no parent

if STOP will turn out to be not the last frame in transaction or to have children.

Thus, it is better to ignore it on traversal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my assumption was that if STOP frame is presented then it's a single frame without parents/children.
i checked several STOP frames from three networks (base, optimism, zora) and all the time it was a single frame

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i checked several STOP frames from three networks (base, optimism, zora) and all the time it was a single frame

Then, you have to make the assumption explicit by asserting it!

// We ignore `STOP` frame because it doesn't affect indexing
break
default:
throw unexpectedCase(rec.frame.type)
}
Expand Down
2 changes: 1 addition & 1 deletion evm/evm-processor/src/ds-rpc/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export type TraceTracers = 'trace' | 'stateDiff'


export interface DebugFrame {
type: 'CALL' | 'STATICCALL' | 'DELEGATECALL' | 'CREATE' | 'CREATE2' | 'SELFDESTRUCT' | 'INVALID'
type: 'CALL' | 'STATICCALL' | 'DELEGATECALL' | 'CREATE' | 'CREATE2' | 'SELFDESTRUCT' | 'INVALID' | 'STOP'
from: Bytes20
to: Bytes20
value?: Qty
Expand Down
Loading