Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
32 changes: 31 additions & 1 deletion bin/alpen-client/src/payload_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use alpen_reth_node::{
use eyre::{eyre, Context};
use reth_node_builder::{ConsensusEngineHandle, PayloadBuilderAttributes};
use reth_payload_builder::PayloadBuilderHandle;
use tracing::{debug, warn};
use tracing::{debug, info, warn};

#[derive(Debug)]
pub(crate) struct AlpenRethPayloadEngine {
Expand Down Expand Up @@ -76,6 +76,15 @@ impl PayloadBuilderEngine for AlpenRethPayloadEngine {
})
})
.collect::<Result<Vec<Withdrawal>, _>>()?;
for (deposit_index, withdrawal) in withdrawals.iter().enumerate() {
info!(
%parent,
deposit_index,
address = %withdrawal.address,
amount_gwei = withdrawal.amount,
"prepared deposit mint for payload attributes",
);
Comment on lines +79 to +86
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this withdrawals is Eth beacon chain withdrawals, so our deposits. If so, why withdrawal.address and not deposit.address (i.e. withdrawal --> deposit). Also curious, where do we get deposit_index at this stage? Is this necessarily the same deposit_index as in the bridge, or internal to reth? (or is it just 'local' indexing within this block?)
On the latter, just in case, see https://alpenlabs.atlassian.net/browse/STR-3567: the report says that the issue is in the RPC, but maybe it's deeper than that. (maybe we have some indexing issue at this level)

}
let payload_attrs = AlpenPayloadAttributes::new_from_eth(PayloadAttributes {
timestamp: build_attrs.timestamp(),
// IMPORTANT: post cancun payload build will fail without
Expand All @@ -102,6 +111,16 @@ impl PayloadBuilderEngine for AlpenRethPayloadEngine {
.await
{
Ok(Ok(payload_id)) => {
if deposit_count > 0 {
info!(
%parent,
timestamp,
deposit_count,
?payload_id,
elapsed_ms = build_started.elapsed().as_millis(),
"payload builder accepted deposit mint job",
);
}
debug!(
%parent,
timestamp,
Expand Down Expand Up @@ -143,6 +162,17 @@ impl PayloadBuilderEngine for AlpenRethPayloadEngine {
.await
{
Some(Ok(payload)) => {
if deposit_count > 0 {
info!(
%parent,
timestamp,
deposit_count,
?payload_id,
resolve_elapsed_ms = resolve_started.elapsed().as_millis(),
total_elapsed_ms = build_started.elapsed().as_millis(),
"payload builder resolved deposit mint payload",
);
}
debug!(
%parent,
timestamp,
Expand Down
21 changes: 16 additions & 5 deletions crates/alpen-ee/block-assembly/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use strata_msg_fmt::{Msg as MsgTrait, OwnedMsg};
use strata_ol_bridge_types::OperatorSelection;
use strata_ol_msg_types::{WithdrawalMsgData, DEFAULT_OPERATOR_FEE, WITHDRAWAL_MSG_TYPE_ID};
use strata_snark_acct_runtime::InputMessage;
use tracing::warn;
use tracing::{info, warn};

/// Builds [`ExecInputs`] from parsed input messages.
///
Expand All @@ -26,10 +26,13 @@ pub(crate) fn build_block_inputs(
let value = msg.meta().value();
match msg.message() {
Some(DecodedEeMessageData::Deposit(deposit_msg_data)) => {
inputs.add_subject_deposit(SubjectDepositData::new(
*deposit_msg_data.dest_subject(),
value,
));
let dest_subject = *deposit_msg_data.dest_subject();
info!(
?dest_subject,
amount_sat = value.to_sat(),
"accepted deposit message as EE input",
);
inputs.add_subject_deposit(SubjectDepositData::new(dest_subject, value));
}
Some(DecodedEeMessageData::SubjTransfer(_)) => {
// no need to warn on this
Expand Down Expand Up @@ -63,6 +66,14 @@ pub(crate) fn build_block_outputs<TPayload: EnginePayload>(
);
continue;
};
info!(
withdrawal_txid = ?withdrawal_intent.withdrawal_txid,
amount_sat = withdrawal_intent.amt,
selected_operator = withdrawal_intent.selected_operator.raw(),
dest_desc_len = withdrawal_intent.destination.to_bytes().len(),
%bridge_gateway_account_id,
"created withdrawal output message for bridge gateway",
);
outputs.add_message(OutputMessage::new(bridge_gateway_account_id, msg_payload));
}
outputs
Expand Down
12 changes: 11 additions & 1 deletion crates/alpen-ee/block-assembly/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use alpen_ee_common::{DepositInfo, EnginePayload, PayloadBuildAttributes, Payloa
use alpen_reth_evm::subject_to_address_unchecked;
use strata_acct_types::Hash;
use strata_ee_acct_types::{EeAccountState, PendingInputEntry, UpdateExtraData};
use tracing::debug;
use tracing::{debug, info};

/// Extracts deposits from pending inputs, limited by `max_deposits`.
///
Expand Down Expand Up @@ -43,6 +43,16 @@ pub(crate) async fn build_exec_payload<E: PayloadBuilderEngine>(
// dont handle forced inclusions currently
let processed_fincls = 0;

for (deposit_index, deposit) in deposits.iter().enumerate() {
info!(
%parent,
deposit_index,
address = %deposit.address(),
amount_sat = deposit.amount().to_sat(),
"selected deposit for EE payload",
);
}

debug!(%parent, timestamp = %timestamp_sec, deposits = %processed_inputs, "starting payload build");
let payload = payload_builder
.build_payload(PayloadBuildAttributes::new(parent, timestamp_sec, deposits))
Expand Down
14 changes: 12 additions & 2 deletions crates/ol/stf/src/account_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,22 @@ fn handle_bridge_gateway_message<S: IStateAccessorMut>(
}

// 4. If it is, then we can emit a OL log with the amount and destination.
let selected_operator = withdrawal_data.selected_operator();
let dest = withdrawal_data.into_dest_desc();
let dest_desc_len = dest.len();
let log_data = SimpleWithdrawalIntentLogData {
amt: withdrawal_amt.into(),
selected_operator: withdrawal_data.selected_operator(),
dest: withdrawal_data.into_dest_desc(),
selected_operator,
dest,
};
context.emit_typed_log(BRIDGE_GATEWAY_ACCT_SERIAL, &log_data)?;
info!(
%sender,
amount_sat = amt_raw,
selected_operator,
dest_desc_len,
"emitted bridge withdrawal intent log",
);
coin.safely_consume_unchecked();

Ok(())
Expand Down
22 changes: 17 additions & 5 deletions crates/ol/stf/src/manifest_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ fn process_asm_log<S: IStateAccessorMut>(
);
return Ok(());
};
process_deposit_log(state, &deposit, context)?;
process_deposit_log(state, real_height, &deposit, context)?;
}

CHECKPOINT_TIP_UPDATE_LOG_TYPE => {
Expand Down Expand Up @@ -186,6 +186,7 @@ fn process_asm_log<S: IStateAccessorMut>(

fn process_deposit_log<S: IStateAccessorMut>(
state: &mut S,
real_height: L1Height,
deposit: &DepositLog,
context: &BasicExecContext<'_>,
) -> ExecResult<()> {
Expand All @@ -195,7 +196,11 @@ fn process_deposit_log<S: IStateAccessorMut>(
let Ok(descriptor) = DepositDescriptor::decode_from_slice(&deposit.destination) else {
// Malformed destination descriptor, sweep to limbo.
let coin = Coin::new_unchecked(amt_btc);
warn!(amount = %deposit.amount, "limboing deposit with malformed destination descriptor");
warn!(
l1_height = real_height,
amount_sat = deposit.amount,
"limboing deposit with malformed destination descriptor",
);
handle_misplaced_funds(state, coin)?;
return Ok(());
};
Expand All @@ -207,7 +212,12 @@ fn process_deposit_log<S: IStateAccessorMut>(
let Some(dest_id) = state.find_account_id_by_serial(acct_serial)? else {
// Account serial not found, sweep to limbo.
let coin = Coin::new_unchecked(amt_btc);
warn!(?acct_serial, amount = %deposit.amount, "limboing deposit for unknown account serial");
warn!(
l1_height = real_height,
?acct_serial,
amount_sat = deposit.amount,
"limboing deposit for unknown account serial",
);
handle_misplaced_funds(state, coin)?;
return Ok(());
};
Expand All @@ -221,10 +231,12 @@ fn process_deposit_log<S: IStateAccessorMut>(
let msg_payload = MsgPayload::from_bytes(deposit.amount.into(), deposit_data)
.expect("deposit message payload bytes must fit within SSZ max length");

debug!(
info!(
l1_height = real_height,
%dest_id,
%acct_serial,
amount = deposit.amount,
?subject_id,
amount_sat = deposit.amount,
"crediting deposit to account",
);

Expand Down
Loading