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

Option to display module specific instruction names #252

Open
OlivierBBB opened this issue Aug 23, 2024 · 4 comments
Open

Option to display module specific instruction names #252

OlivierBBB opened this issue Aug 23, 2024 · 4 comments
Assignees

Comments

@OlivierBBB
Copy link
Collaborator

OlivierBBB commented Aug 23, 2024

The following modules MMU / MMIO / OOB / EXP / ... have their own "instruction sets" independent of the EVM's instruction set, see the respective specifications. These are typically 2 byte integers (to differentiate them from the 1 byte opcodes of the EVM.) It would be great help if we could annotate these columns in corset to display the associated instruction names in corset inspect. The current state of things makes it hard to deciper what is going on.

Here is an example from the MMU module. The MMU module has 3 "instruction" columns

  • the macro/MMU_INST column it gets from the HUB, it contains values from the MMU's instruction set
  • the micro/MMIO_INST column it provides the MMIO module with, containing values from the MMIO's instruction set
  • the wcp/INST column it provides the WCP module with, containing regular EVM instructions

The stuff below is supposed to represent the sequence of MMU instructions the HUB creates in response to dealing with KECCAK, MSTORE, KECCAK, MSTORE, LOG2, REVERT (with LOG2 deliberately not drawn due to reverting and REVERT missing for reasons I'm still investigating due to this being the root context of the transaction.)

image
@letypequividelespoubelles
Copy link
Contributor

we introduced LEQ and GEQ for WCP too. He's not dealing with only EVM's instructions.

@OlivierBBB
Copy link
Collaborator Author

@letypequividelespoubelles yes

@DavePearce
Copy link
Collaborator

So, currently there is a display option :opcode. You're thinking of something like that?

@OlivierBBB
Copy link
Collaborator Author

OlivierBBB commented Nov 21, 2024

Yes. For instance we have special "opcodes" for OOB and MMU. E.g.

OOB_INST_CALL            <-->  0x ca
OOB_INST_SHA2            <-->  0x ff 02
MMU_INST_BLAKE2F_PARAMS  <-->  <some value I don't recall>
MMIO_INST_mload          <-->  <some value I don't recall>

E.g. when we do a STATICCALL to the SHA2-256 precompile we see both 0x ca and 0x ff 02 rather than the expected OOB_INST_CALL and OOB_INST_SHA2.

image

It would be nicer if we could display e.g. OOB_INST_CALL etc ... rather than these cryptic pseudo opcodes. Also since the LHS of the screen displays the column name (e.g. misc/OOB_INST, misc/MMU_INST, misc/EXP_INST, misc/MXP_INST) we don't need to include the XXX_INST_ prefix in the display name.

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

No branches or pull requests

3 participants