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

Reuse calculated tx id in executor #1248

Merged
merged 7 commits into from
Jul 12, 2023
Merged
Changes from 2 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
11 changes: 7 additions & 4 deletions crates/fuel-core/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ where
let min_fee = checked_tx.metadata().min_fee();
let max_fee = checked_tx.metadata().max_fee();

self.verify_tx_predicates(&checked_tx)?;
self.verify_tx_predicates(&checked_tx, tx_id)?;

if options.utxo_validation {
// validate utxos exist and maturity is properly set
Expand Down Expand Up @@ -1061,12 +1061,15 @@ where
}

/// Verify all the predicates of a tx.
pub fn verify_tx_predicates<Tx>(&self, tx: &Checked<Tx>) -> ExecutorResult<()>
pub fn verify_tx_predicates<Tx>(
&self,
tx: &Checked<Tx>,
id: TxId,
) -> ExecutorResult<()>
where
Tx: ExecutableTransaction,
<Tx as IntoChecked>::Metadata: CheckedMetadata,
{
let id = tx.id();
if Interpreter::<PredicateStorage>::check_predicates(
tx,
self.config.transaction_parameters,
Expand Down Expand Up @@ -1536,7 +1539,7 @@ where

fn persist_receipts(
&self,
tx_id: &Bytes32,
tx_id: &TxId,
receipts: &[Receipt],
db: &mut Database,
) -> ExecutorResult<()> {
Expand Down
Loading