diff --git a/proto_v2/exec_v2.options b/proto_v2/exec_v2.options new file mode 100644 index 0000000..a2ffc40 --- /dev/null +++ b/proto_v2/exec_v2.options @@ -0,0 +1,21 @@ +exec_v2.proto package:"fd_v2" + +fd_v2.SeedAddress.base max_size:32 fixed_length:true +fd_v2.SeedAddress.seed max_size:32 fixed_length:true +fd_v2.SeedAddress.owner max_size:32 fixed_length:true + +fd_v2.AcctState.address max_size:32 fixed_length:true +fd_v2.AcctState.data type:FT_POINTER +fd_v2.AcctState.owner max_size:32 fixed_length:true + +fd_v2.Feature.feature_id max_size:32 fixed_length:true + +fd_v2.LeaderSchedule.pubkey type:FT_POINTER +fd_v2.LeaderSchedule.idxs type:FT_POINTER + +fd_v2.ExecEnv.acct_states type:FT_POINTER +fd_v2.ExecEnv.features type:FT_POINTER +fd_v2.ExecEnv.slots type:FT_POINTER + +fd_v2.ExecEffects.slot_effects type:FT_POINTER +fd_v2.ExecEffects.acct_states type:FT_POINTER \ No newline at end of file diff --git a/proto_v2/exec_v2.proto b/proto_v2/exec_v2.proto index d73a6ba..ee131c5 100644 --- a/proto_v2/exec_v2.proto +++ b/proto_v2/exec_v2.proto @@ -3,6 +3,13 @@ package fd.v2; import "slot_v2.proto"; +enum HarnessType { + INSTR = 0; + TXN = 1; + SLOT = 2; + RUNTIME = 3; +} + message SeedAddress { /* The seed address base. (32 bytes) */ bytes base = 1; @@ -61,37 +68,45 @@ message RentSchedule { } message StatusCache { - /* Vector of transaction hashes that exist in the status cache. */ + /* Vector of transaction hashes that exist in the status cache. + TODO: fill in the rest of the status cache. */ bytes tx_hashes = 1; - - /* TODO: fill in the rest of the status cache. */ } message ExecEnv { + HarnessType harness_type = 1; + /* Starting account states before harness execution. */ - repeated AcctState acct_states = 1; + repeated AcctState acct_states = 2; /* Feature set for the execution. */ - repeated Feature features = 2; + repeated Feature features = 3; /* Leader schedule for the first epoch. This value is recomputed at the epoch boundary. */ - LeaderSchedule leader_schedule = 3; + LeaderSchedule leader_schedule = 4; /* Slot envs to execute. */ - repeated SlotEnv slots = 4; + repeated SlotEnv slots = 5; /* Status cache of recent transactions. */ - StatusCache status_cache = 5; + StatusCache status_cache = 6; /* 301 most recent blockhashes. */ - bytes block_hash_queue = 6; + bytes block_hash_queue = 7; } message ExecEffects { + HarnessType harness_type = 1; + /* Slot effects. */ - repeated SlotEffects slot_effects = 1; + repeated SlotEffects slot_effects = 2; /* Resulting account states at the end of execution. */ - repeated AcctState acct_states = 2; + repeated AcctState acct_states = 3; +} + +message ExecFixture { + ExecEnv input = 1; + ExecEffects output = 2; } diff --git a/proto_v2/instr_v2.options b/proto_v2/instr_v2.options index 5a51874..3283a1c 100644 --- a/proto_v2/instr_v2.options +++ b/proto_v2/instr_v2.options @@ -1 +1,6 @@ -context.proto include:"../../../nanopb/pb_firedancer.h" +instr_v2.proto include:"../../../nanopb/pb_firedancer.h" + +instr_v2.proto package:"fd_v2" + +fd_v2.InstrEnv.accounts type:FT_POINTER +fd_v2.InstrEnv.data type:FT_POINTER diff --git a/proto_v2/instr_v2.proto b/proto_v2/instr_v2.proto index 9da1b4a..b76d88c 100644 --- a/proto_v2/instr_v2.proto +++ b/proto_v2/instr_v2.proto @@ -11,19 +11,19 @@ message InstrAcct { level than the instruction. */ message InstrEnv { /* Index into the set of txn accounts defined by the TxnEnv. */ - uint32 program_id_idx = 1; + uint32 program_id_idx = 1; /* Indexes into the set of txn accounts defined by the TxnEnv. */ - repeated InstrAcct accounts = 2; + bytes accounts = 2; /* The instruction data */ - bytes data = 3; + bytes data = 3; } message InstrEffects { /* Result of the instruction execution */ - int32 result = 1; + int32 result = 1; /* Custom error code if applicable */ - int32 custom_err = 2; + uint32 custom_err = 2; } diff --git a/proto_v2/slot_v2.options b/proto_v2/slot_v2.options new file mode 100644 index 0000000..a6df1a2 --- /dev/null +++ b/proto_v2/slot_v2.options @@ -0,0 +1,7 @@ +slot_v2.proto package:"fd_v2" + +fd_v2.SlotEnv.txns type:FT_POINTER +fd_v2.SlotEnv.vote_accounts type:FT_POINTER +fd_v2.SlotEnv.stake_accounts type:FT_POINTER + +fd_v2.SlotEffects.txn_effects type:FT_POINTER \ No newline at end of file diff --git a/proto_v2/slot_v2.proto b/proto_v2/slot_v2.proto index f996846..55c92d7 100644 --- a/proto_v2/slot_v2.proto +++ b/proto_v2/slot_v2.proto @@ -35,7 +35,7 @@ message SlotEnv { message SlotEffects { /* The resulting state after each transaction in the slot */ - repeated TxnEffects txn_envs = 1; + repeated TxnEffects txn_effects = 1; /* Capitalization for the end of the slot */ uint64 capitalization = 2; diff --git a/proto_v2/txn_v2.options b/proto_v2/txn_v2.options new file mode 100644 index 0000000..de033bb --- /dev/null +++ b/proto_v2/txn_v2.options @@ -0,0 +1,15 @@ +txn_v2.proto package:"fd_v2" + +fd_v2.LUTEntry.account_key max_size:32 fixed_length:true +fd_v2.LUTEntry.writable_indexes type:FT_POINTER +fd_v2.LUTEntry.readonly_indexes type:FT_POINTER + +fd_v2.TxnEnv.account_keys type:FT_POINTER +fd_v2.TxnEnv.instrs type:FT_POINTER +fd_v2.TxnEnv.recent_blockhash type:FT_POINTER +fd_v2.TxnEnv.alut_entries type:FT_POINTER +fd_v2.TxnEnv.message_hash type:FT_POINTER +fd_v2.TxnEnv.signatures type:FT_POINTER + +fd_v2.TxnEffects.instr_effects type:FT_POINTER +fd_v2.TxnEffects.return_data type:FT_POINTER \ No newline at end of file diff --git a/proto_v2/txn_v2.proto b/proto_v2/txn_v2.proto index d0f7c2a..8d1b4ae 100644 --- a/proto_v2/txn_v2.proto +++ b/proto_v2/txn_v2.proto @@ -30,28 +30,30 @@ message TxnEnv { /* Account keys in order that they are passed into the transaction. The account data actually comes from higher level fuzzers. */ - repeated bytes account_keys = 3; /* Instruction(s) that the transaction executes. */ - repeated InstrEnv instructions = 4; + repeated InstrEnv instrs = 4; /* Recent blockhash provided in the message. */ bytes recent_blockhash = 5; /* Address table lookups that aren't availble in legacy messages. */ - repeated LUTEntry alut_entires = 6; + repeated LUTEntry alut_entries = 6; /* The message hash. */ bytes message_hash = 7; /* The signatures needed in the transaction. */ - repeated bytes signatures = 8; + repeated bytes signatures = 8; + + /* The amount of compute units that the transaction has. */ + uint64 cu_avail = 9; }; message TxnEffects { /* Transaction level error code. */ - bool txn_error = 1; + int32 txn_error_code = 1; /* Resulting account states from each instruction execution. */ repeated InstrEffects instr_effects = 2;