diff --git a/yellow-paper/docs/public-vm/gen/_InstructionSet.mdx b/yellow-paper/docs/public-vm/gen/_InstructionSet.mdx index cbc75189aca..4a28d65d2da 100644 --- a/yellow-paper/docs/public-vm/gen/_InstructionSet.mdx +++ b/yellow-paper/docs/public-vm/gen/_InstructionSet.mdx @@ -327,15 +327,7 @@ context.machineState.pc = loc`} } - 0x27 [`INTERNALCALLDEPTH`](#isa-section-internalcalldepth) - Get the depth of the current context's internal call stack - 56 - { - `M[dstOffset] = context.machineState.internalCallStack.length` - } - - - 0x28 [`SET`](#isa-section-set) + 0x27 [`SET`](#isa-section-set) Set a memory word from a constant in the bytecode 64+N { @@ -343,7 +335,7 @@ context.machineState.pc = loc`} } - 0x29 [`MOV`](#isa-section-mov) + 0x28 [`MOV`](#isa-section-mov) Move a word from source memory location to destination 88 { @@ -351,7 +343,7 @@ context.machineState.pc = loc`} } - 0x2a [`CMOV`](#isa-section-cmov) + 0x29 [`CMOV`](#isa-section-cmov) Move a word (conditionally chosen) from one memory location to another (`d = cond > 0 ? a : b`) 152 { @@ -359,7 +351,7 @@ context.machineState.pc = loc`} } - 0x2b [`BLOCKHEADERBYNUM`](#isa-section-blockheaderbynum) + 0x2a [`BLOCKHEADERBYNUM`](#isa-section-blockheaderbynum) Get the block header as of the specified block number 88 { @@ -367,7 +359,7 @@ context.machineState.pc = loc`} } - 0x2c [`SLOAD`](#isa-section-sload) + 0x2b [`SLOAD`](#isa-section-sload) Load a word from storage 88 { @@ -375,7 +367,7 @@ context.machineState.pc = loc`} } - 0x2d [`SSTORE`](#isa-section-sstore) + 0x2c [`SSTORE`](#isa-section-sstore) Write a word to storage 88 { @@ -383,7 +375,7 @@ context.machineState.pc = loc`} } - 0x2e [`READL1TOL2MSG`](#isa-section-readl1tol2msg) + 0x2d [`READL1TOL2MSG`](#isa-section-readl1tol2msg) Reads an L1-to-L2 message 120 { @@ -391,7 +383,7 @@ context.machineState.pc = loc`} } - 0x2f [`SENDL2TOL1MSG`](#isa-section-sendl2tol1msg) + 0x2e [`SENDL2TOL1MSG`](#isa-section-sendl2tol1msg) Send an L2-to-L1 message 88 { @@ -399,7 +391,7 @@ context.machineState.pc = loc`} } - 0x30 [`EMITNOTEHASH`](#isa-section-emitnotehash) + 0x2f [`EMITNOTEHASH`](#isa-section-emitnotehash) Emit a new note hash to be inserted into the notes tree 56 { @@ -407,7 +399,7 @@ context.machineState.pc = loc`} } - 0x31 [`EMITNULLIFIER`](#isa-section-emitnullifier) + 0x30 [`EMITNULLIFIER`](#isa-section-emitnullifier) Emit a new nullifier to be inserted into the nullifier tree 56 { @@ -415,7 +407,7 @@ context.machineState.pc = loc`} } - 0x32 [`EMITUNENCRYPTEDLOG`](#isa-section-emitunencryptedlog) + 0x31 [`EMITUNENCRYPTEDLOG`](#isa-section-emitunencryptedlog) Emit an unencrypted log 88 { @@ -423,7 +415,7 @@ context.machineState.pc = loc`} } - 0x33 [`CALL`](#isa-section-call) + 0x32 [`CALL`](#isa-section-call) Call into another contract 248 @@ -435,7 +427,7 @@ context.machineState.pc = loc`} - 0x34 [`STATICCALL`](#isa-section-staticcall) + 0x33 [`STATICCALL`](#isa-section-staticcall) Call into another contract, disallowing World State and Accrued Substate modifications 248 @@ -447,7 +439,7 @@ context.machineState.pc = loc`} - 0x35 [`RETURN`](#isa-section-return) + 0x34 [`RETURN`](#isa-section-return) Halt execution within this context (without revert), optionally returning some data 88 @@ -456,7 +448,7 @@ halt`} - 0x36 [`REVERT`](#isa-section-revert) + 0x35 [`REVERT`](#isa-section-revert) Halt execution within this context as `reverted`, optionally returning some data 88 @@ -1187,29 +1179,12 @@ Return from an internal call. Pop from the internal call stack and jump to the p [![](./images/bit-formats/INTERNALRETURN.png)](./images/bit-formats/INTERNALRETURN.png) -### `INTERNALCALLDEPTH` -Get the depth of the current context's internal call stack - -[See in table.](#isa-table-internalcalldepth) - -- **Opcode**: 0x27 -- **Category**: Machine State - Control Flow -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.machineState.internalCallStack.length` -- **Tag updates**: `T[dstOffset] = u32` -- **Bit-size**: 56 - -[![](./images/bit-formats/INTERNALCALLDEPTH.png)](./images/bit-formats/INTERNALCALLDEPTH.png) - ### `SET` Set a memory word from a constant in the bytecode [See in table.](#isa-table-set) -- **Opcode**: 0x28 +- **Opcode**: 0x27 - **Category**: Machine State - Memory - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1229,7 +1204,7 @@ Move a word from source memory location to destination [See in table.](#isa-table-mov) -- **Opcode**: 0x29 +- **Opcode**: 0x28 - **Category**: Machine State - Memory - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1247,7 +1222,7 @@ Move a word (conditionally chosen) from one memory location to another (`d = con [See in table.](#isa-table-cmov) -- **Opcode**: 0x2a +- **Opcode**: 0x29 - **Category**: Machine State - Memory - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1268,7 +1243,7 @@ Get the block header as of the specified block number [See in table.](#isa-table-blockheaderbynum) -- **Opcode**: 0x2b +- **Opcode**: 0x2a - **Category**: World State - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1286,7 +1261,7 @@ Load a word from storage [See in table.](#isa-table-sload) -- **Opcode**: 0x2c +- **Opcode**: 0x2b - **Category**: World State - Public Storage - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1305,7 +1280,7 @@ Write a word to storage [See in table.](#isa-table-sstore) -- **Opcode**: 0x2d +- **Opcode**: 0x2c - **Category**: World State - Public Storage - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1323,7 +1298,7 @@ Reads an L1-to-L2 message [See in table.](#isa-table-readl1tol2msg) -- **Opcode**: 0x2e +- **Opcode**: 0x2d - **Category**: World State - Messaging - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1342,7 +1317,7 @@ Send an L2-to-L1 message [See in table.](#isa-table-sendl2tol1msg) -- **Opcode**: 0x2f +- **Opcode**: 0x2e - **Category**: World State - Messaging - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1359,7 +1334,7 @@ Emit a new note hash to be inserted into the notes tree [See in table.](#isa-table-emitnotehash) -- **Opcode**: 0x30 +- **Opcode**: 0x2f - **Category**: World State - Notes & Nullifiers - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1375,7 +1350,7 @@ Emit a new nullifier to be inserted into the nullifier tree [See in table.](#isa-table-emitnullifier) -- **Opcode**: 0x31 +- **Opcode**: 0x30 - **Category**: World State - Notes & Nullifiers - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1391,7 +1366,7 @@ Emit an unencrypted log [See in table.](#isa-table-emitunencryptedlog) -- **Opcode**: 0x32 +- **Opcode**: 0x31 - **Category**: Accrued Substate - Logging - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1408,7 +1383,7 @@ Call into another contract [See in table.](#isa-table-call) -- **Opcode**: 0x33 +- **Opcode**: 0x32 - **Category**: Control Flow - Contract Calls - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1446,7 +1421,7 @@ Call into another contract, disallowing World State and Accrued Substate modific [See in table.](#isa-table-staticcall) -- **Opcode**: 0x34 +- **Opcode**: 0x33 - **Category**: Control Flow - Contract Calls - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1482,7 +1457,7 @@ Halt execution within this context (without revert), optionally returning some d [See in table.](#isa-table-return) -- **Opcode**: 0x35 +- **Opcode**: 0x34 - **Category**: Control Flow - Contract Calls - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. @@ -1504,7 +1479,7 @@ Halt execution within this context as `reverted`, optionally returning some data [See in table.](#isa-table-revert) -- **Opcode**: 0x36 +- **Opcode**: 0x35 - **Category**: Control Flow - Contract Calls - **Flags**: - **indirect**: Toggles whether each memory-offset argument is an indirect offset. 0th bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. diff --git a/yellow-paper/docs/public-vm/gen/images/bit-formats/INTERNALCALLDEPTH.png b/yellow-paper/docs/public-vm/gen/images/bit-formats/INTERNALCALLDEPTH.png deleted file mode 100644 index 45f5b1502c3..00000000000 Binary files a/yellow-paper/docs/public-vm/gen/images/bit-formats/INTERNALCALLDEPTH.png and /dev/null differ diff --git a/yellow-paper/src/preprocess/InstructionSet/InstructionSet.js b/yellow-paper/src/preprocess/InstructionSet/InstructionSet.js index 08b1d6233ab..776890efff9 100644 --- a/yellow-paper/src/preprocess/InstructionSet/InstructionSet.js +++ b/yellow-paper/src/preprocess/InstructionSet/InstructionSet.js @@ -674,22 +674,6 @@ context.machineState.pc = loc "Tag checks": "", "Tag updates": "", }, - { - "id": "internalcalldepth", - "Name": "`INTERNALCALLDEPTH`", - "Category": "Machine State - Control Flow", - "Flags": [ - {"name": "indirect", "description": INDIRECT_FLAG_DESCRIPTION}, - ], - "Args": [ - {"name": "dstOffset", "description": "memory offset specifying where to store operation's result"}, - ], - "Expression": "`M[dstOffset] = context.machineState.internalCallStack.length`", - "Summary": "Get the depth of the current context's internal call stack", - "Details": "", - "Tag checks": "", - "Tag updates": "`T[dstOffset] = u32`", - }, { "id": "set", "Name": "`SET`",