mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-07 16:23:12 +00:00
Minor fixes to context creation (#961)
This commit is contained in:
parent
7a65b1d4df
commit
ab692252ba
@ -18,7 +18,6 @@ global sys_call:
|
|||||||
%address %set_new_ctx_caller
|
%address %set_new_ctx_caller
|
||||||
DUP5 %set_new_ctx_value
|
DUP5 %set_new_ctx_value
|
||||||
DUP5 DUP5 %address %transfer_eth
|
DUP5 DUP5 %address %transfer_eth
|
||||||
%set_new_ctx_parent_ctx
|
|
||||||
%set_new_ctx_parent_pc(after_call_instruction)
|
%set_new_ctx_parent_pc(after_call_instruction)
|
||||||
|
|
||||||
// TODO: Copy memory[args_offset..args_offset + args_size] CALLDATA
|
// TODO: Copy memory[args_offset..args_offset + args_size] CALLDATA
|
||||||
@ -49,7 +48,6 @@ global sys_callcode:
|
|||||||
%address %set_new_ctx_caller
|
%address %set_new_ctx_caller
|
||||||
DUP5 %set_new_ctx_value
|
DUP5 %set_new_ctx_value
|
||||||
DUP5 DUP5 %address %transfer_eth
|
DUP5 DUP5 %address %transfer_eth
|
||||||
%set_new_ctx_parent_ctx
|
|
||||||
%set_new_ctx_parent_pc(after_call_instruction)
|
%set_new_ctx_parent_pc(after_call_instruction)
|
||||||
|
|
||||||
// stack: new_ctx, kexit_info, gas, address, value, args_offset, args_size, ret_offset, ret_size
|
// stack: new_ctx, kexit_info, gas, address, value, args_offset, args_size, ret_offset, ret_size
|
||||||
@ -79,7 +77,6 @@ global sys_staticcall:
|
|||||||
DUP4 %set_new_ctx_addr
|
DUP4 %set_new_ctx_addr
|
||||||
%address %set_new_ctx_caller
|
%address %set_new_ctx_caller
|
||||||
PUSH 0 %set_new_ctx_value
|
PUSH 0 %set_new_ctx_value
|
||||||
%set_new_ctx_parent_ctx
|
|
||||||
%set_new_ctx_parent_pc(after_call_instruction)
|
%set_new_ctx_parent_pc(after_call_instruction)
|
||||||
|
|
||||||
%stack (new_ctx, kexit_info, gas, address, args_offset, args_size, ret_offset, ret_size)
|
%stack (new_ctx, kexit_info, gas, address, args_offset, args_size, ret_offset, ret_size)
|
||||||
@ -105,7 +102,6 @@ global sys_delegatecall:
|
|||||||
%address %set_new_ctx_addr
|
%address %set_new_ctx_addr
|
||||||
%caller %set_new_ctx_caller
|
%caller %set_new_ctx_caller
|
||||||
%callvalue %set_new_ctx_value
|
%callvalue %set_new_ctx_value
|
||||||
%set_new_ctx_parent_ctx
|
|
||||||
%set_new_ctx_parent_pc(after_call_instruction)
|
%set_new_ctx_parent_pc(after_call_instruction)
|
||||||
|
|
||||||
%stack (new_ctx, kexit_info, gas, address, args_offset, args_size, ret_offset, ret_size)
|
%stack (new_ctx, kexit_info, gas, address, args_offset, args_size, ret_offset, ret_size)
|
||||||
|
|||||||
@ -1,13 +1,10 @@
|
|||||||
// Return the next context ID, and record the old context ID in the new one's
|
// Return the next context ID, and record the old context ID in the new one's
|
||||||
// @CTX_METADATA_PARENT_CONTEXT field. Does not actually enter the new context.
|
// @CTX_METADATA_PARENT_CONTEXT field. Does not actually enter the new context.
|
||||||
%macro create_context
|
%macro create_context
|
||||||
|
// stack: (empty)
|
||||||
%next_context_id
|
%next_context_id
|
||||||
GET_CONTEXT
|
%set_new_ctx_parent_ctx
|
||||||
%stack (ctx, next_ctx)
|
// stack: new_ctx
|
||||||
-> (next_ctx, @SEGMENT_NORMALIZED_TXN, @CTX_METADATA_PARENT_CONTEXT,
|
|
||||||
ctx, next_ctx)
|
|
||||||
MSTORE_GENERAL
|
|
||||||
// stack: next_ctx
|
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
// Get and increment @GLOBAL_METADATA_LARGEST_CONTEXT to determine the next context ID.
|
// Get and increment @GLOBAL_METADATA_LARGEST_CONTEXT to determine the next context ID.
|
||||||
|
|||||||
@ -132,7 +132,7 @@ impl Segment {
|
|||||||
Segment::KernelGeneral2 => 256,
|
Segment::KernelGeneral2 => 256,
|
||||||
Segment::KernelAccountCode => 8,
|
Segment::KernelAccountCode => 8,
|
||||||
Segment::TxnFields => 256,
|
Segment::TxnFields => 256,
|
||||||
Segment::TxnData => 256,
|
Segment::TxnData => 8,
|
||||||
Segment::RlpRaw => 8,
|
Segment::RlpRaw => 8,
|
||||||
Segment::TrieData => 256,
|
Segment::TrieData => 256,
|
||||||
Segment::TrieEncodedChild => 256,
|
Segment::TrieEncodedChild => 256,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user