pub struct TransactionScriptsVerifier<'a, DL> { /* private fields */ }
Expand description

This struct leverages CKB VM to verify transaction inputs.

FlatBufferBuilder owned Vec<u8> that grows as needed, in the future, we might refactor this to share buffer to achieve zero-copy

Implementations§

Creates a script verifier for the transaction.

Params
  • rtx - transaction which cell out points have been resolved.
  • data_loader - used to load cell data.

Sets a callback to handle the debug syscall.

Script can print a message using the debug syscall.

The callback receives two parameters:

  • hash: &Byte32: this is the script hash of currently running script group.
  • message: &str: message passed to the debug syscall.

Extracts actual script binary either in dep cells.

Returns the version of the machine based on the script and the consensus rules.

Verifies the transaction by running scripts.

Params
  • max_cycles - Maximum allowed cycles to run the scripts. The verification quits early when the consumed cycles exceed the limit.
Returns

It returns the total consumed cycles on success, Otherwise it returns the verification error.

Performing a resumable verification on the transaction scripts.

Params
  • limit_cycles - Maximum allowed cycles to run the scripts. The verification quits early when the consumed cycles exceed the limit.
Returns

It returns the total consumed cycles if verification completed, If verify is suspended, a state will returned.

Resuming an suspended verify from snapshot

Params
  • snap - Captured transaction verification snapshot.

  • limit_cycles - Maximum allowed cycles to run the scripts. The verification quits early when the consumed cycles exceed the limit.

Returns

It returns the total consumed cycles if verification completed, If verify is suspended, a borrowed state will returned.

Resuming an suspended verify from vm state

Params
  • state - vm state.

  • limit_cycles - Maximum allowed cycles to run the scripts. The verification quits early when the consumed cycles exceed the limit.

Returns

It returns the total consumed cycles if verification completed, If verify is suspended, a borrowed state will returned.

Complete an suspended verify

Params
  • snap - Captured transaction verification snapshot.

  • max_cycles - Maximum allowed cycles to run the scripts. The verification quits early when the consumed cycles exceed the limit.

Returns

It returns the total consumed cycles on completed, Otherwise it returns the verification error.

Runs a single script in current transaction, while this is not useful for CKB itself, it can be very helpful when building a CKB debugger.

Returns all script groups.

Returns all script groups with type.

Finds the script group from cell deps.

Prepares syscalls.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
TODO(doc): @quake
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.