Skip to content
Merged
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
2 changes: 2 additions & 0 deletions proto/context.options
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ fd_exec_test.EpochContext.vote_accounts_t_2 type:FT_POINTER
fd_exec_test.SlotContext.poh max_size:32 fixed_length:true
fd_exec_test.SlotContext.parent_bank_hash max_size:32 fixed_length:true
fd_exec_test.SlotContext.parent_lthash max_size:2048 fixed_length:true

fd_exec_test.BlockhashQueueEntry.blockhash max_size:32 fixed_length:true
35 changes: 35 additions & 0 deletions proto/context.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,35 @@ message FeeRateGovernor {
uint32 burn_percent = 5;
}

message EpochSchedule {
// The maximum number of slots in each epoch.
uint64 slots_per_epoch = 1;

// A number of slots before beginning of an epoch to calculate
// a leader schedule for that epoch.
uint64 leader_schedule_slot_offset = 2;

// Whether epochs start short and grow.
bool warmup = 3;

// The first epoch after the warmup period.
uint64 first_normal_epoch = 4;

// The first slot after the warmup period.
uint64 first_normal_slot = 5;
}

message Rent {
// Rental rate in lamports/byte-year.
uint64 lamports_per_byte_year = 1;

// Amount of time (in years) a balance must include rent for the account to be rent exempt.
double exemption_threshold = 2;

// The percentage of collected rent that is burned.
uint32 burn_percent = 3;
}

// EpochContext includes context scoped to an epoch.
// On "real" ledgers, it is created during the epoch boundary.
message EpochContext {
Expand Down Expand Up @@ -113,3 +142,9 @@ message SlotContext {
// Parent signature count (used for fee rate governor)
uint64 parent_signature_count = 10;
}

// A single entry in the blockhash queue.
message BlockhashQueueEntry {
bytes blockhash = 1;
uint64 lamports_per_signature = 2;
}
9 changes: 4 additions & 5 deletions proto/txn.options
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ fd_exec_test.TransactionMessage.address_table_lookups type:FT_POINTER
fd_exec_test.SanitizedTransaction.message_hash max_size:32 fixed_length:true
fd_exec_test.SanitizedTransaction.signatures type:FT_POINTER

fd_exec_test.TxnContext.account_shared_data type:FT_POINTER
fd_exec_test.TxnContext.blockhash_queue type:FT_POINTER
fd_exec_test.TxnBank.blockhash_queue type:FT_POINTER

fd_exec_test.ResultingState.acct_states type:FT_POINTER
fd_exec_test.ResultingState.rent_debits type:FT_POINTER
fd_exec_test.TxnContext.account_shared_data type:FT_POINTER

fd_exec_test.RentDebits.pubkey max_size:32 fixed_length:true
fd_exec_test.TxnResult.modified_accounts type:FT_POINTER
fd_exec_test.TxnResult.rollback_accounts type:FT_POINTER

fd_exec_test.TxnResult.return_data type:FT_POINTER
49 changes: 28 additions & 21 deletions proto/txn.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ message SanitizedTransaction {
repeated bytes signatures = 4;
}

/* Bank fields relevant to transaction execution */
message TxnBank {
// Up to 300 (actually 301) most recent blockhashes (ordered from oldest to newest)
repeated BlockhashQueueEntry blockhash_queue = 1;

uint32 rbh_lamports_per_signature = 2;

FeeRateGovernor fee_rate_governor = 3;

uint64 total_epoch_stake = 4;

EpochSchedule epoch_schedule = 5;

Rent rent = 6;

FeatureSet features = 7;

uint64 epoch = 8;
}

// This Transaction context be used to fuzz either `load_execute_and_commit_transactions`,
// `load_and_execute_transactions` in `bank.rs` or `load_and_execute_sanitized_transactions`
// in `svm/transaction_processor.rs`
Expand All @@ -67,24 +87,10 @@ message TxnContext {
// Data associated with transaction accounts, sysvars, etc.
repeated AcctState account_shared_data = 2;

// Up to 300 (actually 301) most recent blockhashes (ordered from oldest to newest)
repeated bytes blockhash_queue = 3;
reserved 3, 4, 5;

EpochContext epoch_ctx = 4;
reserved 5;
}

// The resulting state of an account after a transaction
message ResultingState {
repeated AcctState acct_states = 1;
repeated RentDebits rent_debits = 2;
uint64 transaction_rent = 3;
}

// The rent state for an account after a transaction
message RentDebits {
bytes pubkey = 1;
int64 rent_collected = 2;
/* Bank fields for the transaction fuzzer */
TxnBank bank = 6;
}

message FeeDetails {
Expand All @@ -98,9 +104,8 @@ message TxnResult {
bool executed = 1;
// Whether there was a sanitization error
bool sanitization_error = 2;
// The state of each account after the transaction
ResultingState resulting_state = 3;
uint64 rent = 4;

reserved 3, 4;

// If an executed transaction has no error
bool is_ok = 5;
Expand All @@ -113,7 +118,6 @@ message TxnResult {
// Custom error, if any
uint32 custom_error = 9;


// The return data from this transaction, if any
bytes return_data = 10;
// Number of executed compute units
Expand All @@ -122,6 +126,9 @@ message TxnResult {
FeeDetails fee_details = 12;
// Loaded accounts data size
uint64 loaded_accounts_data_size = 13;

repeated AcctState modified_accounts = 14;
repeated AcctState rollback_accounts = 15;
}

// Txn fixtures
Expand Down