mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-04 23:03:08 +00:00
Copy txn data to calldata (#935)
This commit is contained in:
parent
8e04cbfe8d
commit
46d5e62a13
@ -169,6 +169,14 @@ global after_call_instruction:
|
||||
// stack: new_ctx
|
||||
%endmacro
|
||||
|
||||
%macro set_new_ctx_calldata_size
|
||||
// stack: calldata_size, new_ctx
|
||||
%stack (calldata_size, new_ctx)
|
||||
-> (new_ctx, @SEGMENT_CONTEXT_METADATA, @CTX_METADATA_CALLDATA_SIZE, calldata_size, new_ctx)
|
||||
MSTORE_GENERAL
|
||||
// stack: new_ctx
|
||||
%endmacro
|
||||
|
||||
%macro set_new_ctx_gas_limit
|
||||
// stack: gas_limit, new_ctx
|
||||
%stack (gas_limit, new_ctx)
|
||||
|
||||
@ -220,8 +220,14 @@ global process_message_txn_code_loaded:
|
||||
%non_intrinisic_gas %set_new_ctx_gas_limit
|
||||
// stack: new_ctx, retdest
|
||||
|
||||
// TODO: Copy TXN_DATA to CALLDATA
|
||||
// Set calldatasize and copy txn data to calldata.
|
||||
%mload_txn_field(@TXN_FIELD_DATA_LEN)
|
||||
%stack (calldata_size, new_ctx, retdest) -> (calldata_size, new_ctx, calldata_size, retdest)
|
||||
%set_new_ctx_calldata_size
|
||||
%stack (new_ctx, calldata_size, retdest) -> (new_ctx, @SEGMENT_CALLDATA, 0, 0, @SEGMENT_TXN_DATA, 0, calldata_size, process_message_txn_code_loaded_finish, new_ctx, retdest)
|
||||
%jump(memcpy)
|
||||
|
||||
process_message_txn_code_loaded_finish:
|
||||
%enter_new_ctx
|
||||
// (Old context) stack: new_ctx, retdest
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user