Skip to content

[WIP] add ErrorDepth specs#52

Open
lightsing wants to merge 3 commits into
masterfrom
feat/error-depth
Open

[WIP] add ErrorDepth specs#52
lightsing wants to merge 3 commits into
masterfrom
feat/error-depth

Conversation

@lightsing

Copy link
Copy Markdown

No description provided.

Comment thread specs/error_state/ErrorDepth.md
[FQ(Opcode.CALL), FQ(Opcode.CALLCODE), FQ(Opcode.DELEGATECALL), FQ(Opcode.STATICCALL)]
)

is_call, is_callcode, is_delegatecall, is_staticcall = instruction.multiple_select(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

don't need to check it is call or call code etc.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

but CALL and CALLCODE will consume 7 stack elements and DELEGATECALL and STATICCALL will consume 6 elements


# check the call depth
depth = instruction.call_context_lookup(CallContextFieldTag.Depth)
instruction.constrain_equal(depth, FQ(1025))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should be 1024 because current look up is for caller's depth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants