Return error if Transaction contains writable executable or ProgramData accounts (backport #19629) (#19730)
* Return error if Transaction contains writable executable or ProgramData accounts (#19629)
* Return error if Transaction locks an executable as writable
* Return error if a ProgramData account is writable but the upgradable loader isn't present
* Remove unreachable clause
* Fixup bpf tests
* Review comments
* Add new TransactionError
* Disallow writes to any upgradeable-loader account when loader not present; remove is_upgradeable_loader_present exception for all other executables
(cherry picked from commit 38bbb77989
)
# Conflicts:
# programs/bpf/tests/programs.rs
# runtime/src/accounts.rs
# runtime/src/bank.rs
# sdk/src/transaction.rs
# storage-proto/proto/transaction_by_addr.proto
# storage-proto/src/convert.rs
* Fix conflicts
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
@@ -99,6 +99,19 @@ pub enum TransactionError {
|
||||
/// Transaction processing left an account with an outstanding borrowed reference
|
||||
#[error("Transaction processing left an account with an outstanding borrowed reference")]
|
||||
AccountBorrowOutstanding,
|
||||
|
||||
#[error(
|
||||
"Transaction could not fit into current block without exceeding the Max Block Cost Limit"
|
||||
)]
|
||||
WouldExceedMaxBlockCostLimit,
|
||||
|
||||
/// Transaction version is unsupported
|
||||
#[error("Transaction version is unsupported")]
|
||||
UnsupportedVersion,
|
||||
|
||||
/// Transaction loads a writable account that cannot be written
|
||||
#[error("Transaction loads a writable account that cannot be written")]
|
||||
InvalidWritableAccount,
|
||||
}
|
||||
|
||||
pub type Result<T> = result::Result<T, TransactionError>;
|
||||
|
Reference in New Issue
Block a user