Skip to main content

Module owner_approvals

Module owner_approvals 

Source
Expand description

Tempo configurable account senders whose owners approve on separate machines.

When the local owner keys of a configurable account sender do not reach its threshold, --broadcast first simulates the remaining operations in order up to the account’s last transaction and fixes the gas limit of each of the account’s transactions. It then sends the operations before the account’s first transaction, approves the account’s remaining transactions with the local owners and saves them as AwaitingOwners in the sequence instead of sending them. The other owners sign the printed digests elsewhere. --resume adds the approvals given with --tempo.owner-signature and, once every saved transaction reaches the threshold, the broadcast sends them in order with 0x05 signatures built from the approvals.

Re-exports§

use crate::broadcast::SendTransactionKind; 🔒
use crate::broadcast::convert_tempo_aa_create; 🔒
use crate::broadcast::estimate_gas; 🔒
use crate::broadcast::remaining_operation_indices; 🔒
use crate::sequence::ScriptSequenceKind; 🔒
use alloy_consensus::BlockHeader; 🔒
use alloy_consensus::SignableTransaction; 🔒
use alloy_eips::BlockNumberOrTag; 🔒
use alloy_eips::eip2718::Decodable2718; 🔒
use alloy_eips::eip2718::Encodable2718; 🔒
use alloy_network::BlockResponse; 🔒
use alloy_network::Network; 🔒
use alloy_network::NetworkTransactionBuilder; 🔒
use alloy_network::TransactionBuilder; 🔒
use alloy_primitives::Address; 🔒
use alloy_primitives::B256; 🔒
use alloy_primitives::Bytes; 🔒
use alloy_primitives::TxHash; 🔒
use alloy_primitives::map::HashMap; 🔒
use alloy_provider::Provider; 🔒
use alloy_provider::RootProvider; 🔒
use alloy_rpc_types::simulate::SimBlock; 🔒
use alloy_rpc_types::simulate::SimCallResult; 🔒
use alloy_rpc_types::simulate::SimulatePayload; 🔒
use alloy_rpc_types::simulate::SimulatedBlock; 🔒
use alloy_signer::Signature; 🔒
use eyre::Context; 🔒
use eyre::ContextCompat; 🔒
use eyre::Result; 🔒
use eyre::bail; 🔒
use forge_script_sequence::AwaitingOwners; 🔒
use forge_script_sequence::ScriptSequence; 🔒
use foundry_cli::utils::apply_gas_estimate_multiplier; 🔒
use foundry_common::FoundryTransactionBuilder; 🔒
use foundry_common::provider::ProviderBuilder; 🔒
use foundry_common::shell; 🔒
use foundry_common::tempo::configurable_account::ConfigurableAccountOwnerKey; 🔒
use foundry_common::tempo::configurable_account::combine_approvals; 🔒
use foundry_common::tempo::configurable_account::decode_unsigned_tx; 🔒
use foundry_common::tempo::configurable_account::has_config; 🔒
use foundry_common::tempo::configurable_account::parse_owner_signature; 🔒
use foundry_common::tempo::configurable_account::prepare_request; 🔒
use foundry_common::tempo::configurable_account::reaches_threshold; 🔒
use foundry_common::tempo::configurable_account::simulation_spec; 🔒
use foundry_common::tempo::configurable_account::updates_config; 🔒
use foundry_common::tempo::resolve_and_set_fee_token; 🔒
use foundry_config::Config; 🔒
use itertools::Itertools; 🔒
use serde_json::Value; 🔒
use std::collections::BTreeMap; 🔒
use std::collections::BTreeSet; 🔒
use tempo_alloy::TempoNetwork; 🔒
use tempo_primitives::TempoTxEnvelope; 🔒
use tempo_primitives::transaction::ConfigurableAccountConfig; 🔒
use tempo_primitives::transaction::PrimitiveSignature; 🔒
use tempo_primitives::transaction::TempoSignature; 🔒
use tempo_primitives::transaction::TempoTransaction; 🔒
use tempo_primitives::transaction::configurable_account_digest; 🔒

Structs§

Awaiting 🔒
A transaction of a configurable account with offline owners whose gas limit is fixed, to be saved for its owners once the operations before it are sent.
OfflineOwners
A configurable account sender whose local owner keys do not form a quorum that Tempo accepts, so that the other owners approve its transactions elsewhere.

Constants§

GAS_CAP_HINT 🔒
How to raise a node’s limits on one eth_simulateV1 request.
MAX_SIMULATED_BLOCKS 🔒
The most blocks a node simulates in one eth_simulateV1 request.

Functions§

approved_payload 🔒
Returns the payload of operation index of deployment signed with its owners’ approvals, and its hash, when it was saved for its owners. The signature is rebuilt from the saved approvals, as combine_approvals selects them the same way every time.
assemble 🔒
Adds the owner approvals in signatures to the transactions awaiting their owners, and checks that every one of them that was not sent yet reaches its threshold and can still be sent. The broadcast then sends them in order, signed with the approvals, recording each as a submission attempt only then.
awaiting 🔒
The transactions with offline owners among transactions, with their prepared requests.
awaits_approvals 🔒
Tells whether a saved transaction’s approvals do not reach its threshold yet.
decode_entry 🔒
Decodes a saved transaction, its configuration and the owners’ approvals, and checks its digest.
describe 🔒
Describes the transactions awaiting owner approvals: for each, its digest and the owners that approved it, then how the other owners sign and how to send the transactions.
export 🔒
Saves the transactions of configurable accounts with offline owners that prepare fixed, approved by their local owners, for the other owners to approve instead of sending them. Other operations are left for --resume.
least_gas_limit 🔒
Returns the least gas limit with which the last of requests succeeds after the ones before it, found as eth_estimateGas does and raised by multiplier percent, up to cap. The last request fails with its current gas limit.
prepare 🔒
Fixes the gas limits of the transactions of configurable accounts with offline owners, before anything is sent.
report 🔒
Prints the transactions awaiting owner approvals and how to approve and send them.
simulate 🔒
Simulates requests in order on top of block, so that each runs on the state the ones before it leave: all in one block, or each in a block of its own when per_call is set.
void_reason 🔒
Tells why a saved transaction can no longer be sent with its owners’ approvals: its account’s configuration or nonce, its deadline or the base fee changed on chain. next_nonce is the account’s next nonce, or None when its configuration changed, and latest the latest block, read after them.