Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzz v2 updates #23

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions proto_v2/exec_v2.options
Original file line number Diff line number Diff line change
@@ -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
37 changes: 26 additions & 11 deletions proto_v2/exec_v2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
7 changes: 6 additions & 1 deletion proto_v2/instr_v2.options
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions proto_v2/instr_v2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
7 changes: 7 additions & 0 deletions proto_v2/slot_v2.options
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion proto_v2/slot_v2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 15 additions & 0 deletions proto_v2/txn_v2.options
Original file line number Diff line number Diff line change
@@ -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
12 changes: 7 additions & 5 deletions proto_v2/txn_v2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down