diff --git a/crates/rooch-executor/src/actor/executor.rs b/crates/rooch-executor/src/actor/executor.rs index 7853cd1021..4e235510be 100644 --- a/crates/rooch-executor/src/actor/executor.rs +++ b/crates/rooch-executor/src/actor/executor.rs @@ -41,6 +41,7 @@ use rooch_types::framework::ethereum::EthereumModule; use rooch_types::framework::transaction_validator::TransactionValidator; use rooch_types::framework::{system_post_execute_functions, system_pre_execute_functions}; use rooch_types::multichain_id::RoochMultiChainID; +use rooch_types::transaction::authenticator::AUTH_PAYLOAD_SIZE; use rooch_types::transaction::{ AuthenticatorInfo, L1Block, L1BlockWithBody, L1Transaction, RoochTransaction, RoochTransactionData, @@ -376,7 +377,7 @@ impl ExecutorActor { tx_data.sequence_number, tx_data.max_gas_amount, tx_data.tx_hash(), - tx_data.tx_size(), + tx_data.tx_size() + AUTH_PAYLOAD_SIZE, ); let tx_metadata = TxMeta::new_from_move_action(&tx_data.action); diff --git a/crates/rooch-types/src/transaction/authenticator.rs b/crates/rooch-types/src/transaction/authenticator.rs index aa26dcf4aa..f457290417 100644 --- a/crates/rooch-types/src/transaction/authenticator.rs +++ b/crates/rooch-types/src/transaction/authenticator.rs @@ -30,6 +30,8 @@ use crate::{ use super::RoochTransactionData; +pub const AUTH_PAYLOAD_SIZE: u64 = 219; + /// A `Authenticator` is an abstraction of a account authenticator. /// It is a part of `AccountAbstraction` diff --git a/crates/rooch/src/tx_runner.rs b/crates/rooch/src/tx_runner.rs index 50bc67e320..41eab2c08e 100644 --- a/crates/rooch/src/tx_runner.rs +++ b/crates/rooch/src/tx_runner.rs @@ -22,6 +22,7 @@ use moveos_types::move_std::option::MoveOption; use moveos_types::moveos_std::gas_schedule::GasScheduleConfig; use moveos_types::moveos_std::object::ObjectMeta; use moveos_types::moveos_std::tx_context::TxContext; +use moveos_types::moveos_std::tx_meta::TxMeta; use moveos_types::transaction::{ MoveAction, RawTransactionOutput, VMErrorInfo, VerifiedMoveAction, VerifiedMoveOSTransaction, }; @@ -34,6 +35,7 @@ use rooch_rpc_client::{Client, ClientResolver}; use rooch_types::address::{BitcoinAddress, MultiChainAddress}; use rooch_types::framework::auth_validator::{BuiltinAuthValidator, TxValidateResult}; use rooch_types::framework::system_pre_execute_functions; +use rooch_types::transaction::authenticator::AUTH_PAYLOAD_SIZE; use rooch_types::transaction::RoochTransactionData; use std::rc::Rc; use std::str::FromStr; @@ -55,7 +57,9 @@ pub fn execute_tx_locally( GasScheduleConfig::CLI_DEFAULT_MAX_GAS_AMOUNT, true, ); - gas_meter.charge_io_write(tx.tx_size()).unwrap(); + gas_meter + .charge_io_write(tx.tx_size() + AUTH_PAYLOAD_SIZE) + .unwrap(); let mut moveos_session = MoveOSSession::new( move_mv.inner(), @@ -235,6 +239,9 @@ fn convert_to_verified_tx( tx_data.tx_size(), ); + let tx_metadata = TxMeta::new_from_move_action(&tx_data.action); + tx_ctx.add(tx_metadata).unwrap(); + let mut bitcoin_address = BitcoinAddress::from_str("18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX")?; let user_multi_chain_address: MultiChainAddress = tx_data.sender.into();