-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(yellowpaper): refresh of avm instruction set (#4081)
- Misc cleanup - Recategorized and *reordered* instructions - Updated instruction expressions to match context structure in high-level spec - Removed opcode numbers from section titles as it makes links ugly - Removed opcode numbers from images so they don't need to be regenerated for now - `in-tag` -> `inTag`, same with `dstTag` - Intro Instruction Set section with some relevant notes - Removed misc `*ROOT` opcodes in favor of `BLOCKHEADERBYNUM` opcode - Cleanup in high-level avm spec
- Loading branch information
Showing
75 changed files
with
1,217 additions
and
1,281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,84 @@ | ||
/** | ||
* All avm opcodes | ||
* All AVM opcodes | ||
*/ | ||
export enum Opcodes { | ||
// Arithmetic | ||
// Compute | ||
// Compute - Arithmetic | ||
ADD, | ||
SUB, | ||
MUL, | ||
DIV, | ||
// Compute - Comparators | ||
EQ, | ||
LT, | ||
LTE, | ||
// Compute - Bitwise | ||
AND, | ||
OR, | ||
XOR, | ||
NOT, | ||
SHL, | ||
SHR, | ||
// Compute - Type Conversions | ||
CAST, | ||
// Memory | ||
SET, | ||
MOV, | ||
CMOV, | ||
CALLDATACOPY, | ||
|
||
// Logs | ||
EMITNOTEHASH, | ||
EMITNULLIFIER, | ||
SENDL2TOL1MSG, | ||
ULOG, | ||
// Control flow | ||
JUMP, | ||
JUMPI, | ||
INTERNALCALL, | ||
INTERNALRETURN, | ||
|
||
// Storage | ||
SLOAD, | ||
SSTORE, | ||
// Contract call control flow | ||
RETURN, | ||
REVERT, | ||
CALL, | ||
STATICCALL, | ||
|
||
// Execution Environment | ||
ADDRESS, | ||
STORAGEADDRESS, | ||
ORIGIN, | ||
SENDER, | ||
PORTAL, | ||
FEEPERL1GAS, | ||
FEEPERL2GAS, | ||
FEEPERDAGAS, | ||
CONTRACTCALLDEPTH, | ||
// Execution Environment - Globals | ||
CHAINID, | ||
VERSION, | ||
BLOCKNUMBER, | ||
TIMESTAMP, | ||
COINBASE, | ||
BLOCKL1GASLIMIT, | ||
BLOCKL2GASLIMIT, | ||
NULLIFIERSOOT, | ||
CONTRACTSROOT, | ||
MSGSROOT, | ||
NOTESROOT, | ||
PUBLICDATAROOT, | ||
GLOBALSHASH, | ||
BLOCKSROOT, | ||
GRANDROOT, | ||
BLOCKDAGASLIMIT, | ||
// Execution Environment - Calldata | ||
CALLDATACOPY, | ||
|
||
// Call context | ||
ORIGIN, | ||
REFUNDEE, | ||
FEEPERL1GAS, | ||
FEEPERL2GAS, | ||
CALLER, | ||
ADDRESS, | ||
PORTAL, | ||
CALLDEPTH, | ||
l1GAS, | ||
L2GAS, | ||
// Machine State | ||
// Machine State - Gas | ||
L1GASLEFT, | ||
L2GASLEFT, | ||
DAGASLEFT, | ||
// Machine State - Internal Control Flow | ||
JUMP, | ||
JUMPI, | ||
INTERNALCALL, | ||
INTERNALRETURN, | ||
INTERNALCALLDEPTH, | ||
// Machine State - Memory | ||
SET, | ||
MOV, | ||
CMOV, | ||
|
||
// World State | ||
BLOCKHEADERBYNUMBER, | ||
SLOAD, // Public Storage | ||
SSTORE, // Public Storage | ||
READL1TOL2MSG, // Messages | ||
SENDL2TOL1MSG, // Messages | ||
EMITNOTEHASH, // Notes & Nullifiers | ||
EMITNULLIFIER, // Notes & Nullifiers | ||
|
||
// Accrued Substate | ||
EMITUNENCRYPTEDLOG, | ||
|
||
// Control Flow - Contract Calls | ||
CALL, | ||
STATICCALL, | ||
RETURN, | ||
REVERT, | ||
|
||
// Black box | ||
// Gadgets | ||
KECCAK, | ||
POSEIDON, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.