diff --git a/proto/context.options b/proto/context.options index 3912e30..cfa315d 100644 --- a/proto/context.options +++ b/proto/context.options @@ -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 diff --git a/proto/context.proto b/proto/context.proto index 503a9ef..da75b29 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -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 { @@ -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; +} diff --git a/proto/txn.options b/proto/txn.options index 79044b7..e9f02a9 100644 --- a/proto/txn.options +++ b/proto/txn.options @@ -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 diff --git a/proto/txn.proto b/proto/txn.proto index a0932ae..ee9404e 100644 --- a/proto/txn.proto +++ b/proto/txn.proto @@ -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` @@ -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 { @@ -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; @@ -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 @@ -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