Skip to content

Commit

Permalink
Ban system transactions from dry run (MystenLabs#10037)
Browse files Browse the repository at this point in the history
## Description 

- I see no reason to support them, and might lead to some weirdness

## Test Plan 

- No tests

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
tnowacki authored Mar 31, 2023
1 parent 7e4181b commit df41807
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/sui-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,14 @@ impl AuthorityState {
if !self.is_fullnode(&epoch_store) {
return Err(anyhow!("dry-exec is only supported on fullnodes"));
}
match transaction.kind() {
TransactionKind::ProgrammableTransaction(_) => (),
TransactionKind::ChangeEpoch(_)
| TransactionKind::Genesis(_)
| TransactionKind::ConsensusCommitPrologue(_) => {
return Err(anyhow!("dry-exec does not support system transactions"));
}
}

// make a gas object if one was not provided
let mut gas_object_refs = transaction.gas().to_vec();
Expand Down
1 change: 1 addition & 0 deletions crates/sui-core/src/transaction_input_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pub async fn check_transaction_input_with_given_gas(
transaction: &TransactionData,
gas_object: Object,
) -> SuiResult<(SuiGasStatus<'static>, InputObjects)> {
transaction.check_version_supported(epoch_store.protocol_config())?;
transaction.validity_check_no_gas_check(epoch_store.protocol_config())?;
check_non_system_packages_to_be_published(transaction, epoch_store.protocol_config())?;
let mut input_objects = transaction.input_objects()?;
Expand Down

0 comments on commit df41807

Please sign in to comment.