Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Commit b1593e0

Browse files
committed
solana: auction pubkey -> fast vaa hash in events
1 parent 906b1aa commit b1593e0

File tree

16 files changed

+81
-41
lines changed

16 files changed

+81
-41
lines changed

solana/programs/matching-engine/src/composite/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub struct CheckedCustodian<'info> {
9797
seeds = [Custodian::SEED_PREFIX],
9898
bump = Custodian::BUMP,
9999
)]
100-
pub custodian: Account<'info, Custodian>,
100+
pub custodian: Box<Account<'info, Custodian>>,
101101
}
102102

103103
impl<'info> Deref for CheckedCustodian<'info> {
@@ -138,7 +138,7 @@ pub struct OwnerOnlyMut<'info> {
138138
seeds = [Custodian::SEED_PREFIX],
139139
bump = Custodian::BUMP,
140140
)]
141-
pub custodian: Account<'info, Custodian>,
141+
pub custodian: Box<Account<'info, Custodian>>,
142142
}
143143

144144
#[derive(Accounts)]
@@ -171,7 +171,7 @@ pub struct AdminMut<'info> {
171171
seeds = [Custodian::SEED_PREFIX],
172172
bump = Custodian::BUMP,
173173
)]
174-
pub custodian: Account<'info, Custodian>,
174+
pub custodian: Box<Account<'info, Custodian>>,
175175
}
176176

177177
#[derive(Accounts)]
@@ -195,7 +195,7 @@ pub struct LocalTokenRouter<'info> {
195195
associated_token::mint = common::USDC_MINT,
196196
associated_token::authority = token_router_emitter,
197197
)]
198-
pub token_router_mint_recipient: Account<'info, token::TokenAccount>,
198+
pub token_router_mint_recipient: Box<Account<'info, token::TokenAccount>>,
199199
}
200200

201201
#[derive(Accounts)]
@@ -208,7 +208,7 @@ pub struct ExistingMutRouterEndpoint<'info> {
208208
],
209209
bump = endpoint.bump,
210210
)]
211-
pub endpoint: Account<'info, RouterEndpoint>,
211+
pub endpoint: Box<Account<'info, RouterEndpoint>>,
212212
}
213213

214214
impl<'info> Deref for ExistingMutRouterEndpoint<'info> {
@@ -644,7 +644,7 @@ pub struct ReserveFastFillSequence<'info> {
644644
// This check makes sure that the auction account did not exist before this
645645
// instruction was called.
646646
require!(
647-
auction.vaa_hash == [0; 32],
647+
auction.vaa_hash == <[u8; 32]>::default(),
648648
MatchingEngineError::AuctionExists,
649649
);
650650

solana/programs/matching-engine/src/events/auction_settled.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct SettledTokenAccountInfo {
1111
#[derive(Debug)]
1212
pub struct AuctionSettled {
1313
/// The pubkey of the auction that was settled.
14-
pub auction: Pubkey,
14+
pub fast_vaa_hash: [u8; 32],
1515

1616
/// If there was an active auction, this field will have the pubkey of the best offer token that
1717
/// was paid back and its balance after repayment.

solana/programs/matching-engine/src/events/auction_updated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use anchor_lang::prelude::*;
55
#[derive(Debug)]
66
pub struct AuctionUpdated {
77
pub config_id: u32,
8-
pub auction: Pubkey,
8+
pub fast_vaa_hash: [u8; 32],
99
pub vaa: Option<Pubkey>,
1010
pub source_chain: u16,
1111
pub target_protocol: MessageProtocol,
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use anchor_lang::prelude::*;
22

3+
use crate::state::FastFillSeeds;
4+
35
#[event]
46
pub struct FastFillRedeemed {
57
pub prepared_by: Pubkey,
6-
pub fast_fill: Pubkey,
8+
pub fast_fill: FastFillSeeds,
79
}

solana/programs/matching-engine/src/events/fast_fill_sequence_reserved.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ use anchor_lang::prelude::*;
44
#[event]
55
pub struct FastFillSequenceReserved {
66
pub fast_vaa_hash: [u8; 32],
7-
pub fast_fill_seeds: FastFillSeeds,
7+
pub fast_fill: FastFillSeeds,
88
}

solana/programs/matching-engine/src/events/order_executed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use anchor_lang::prelude::*;
44
#[event]
55
#[derive(Debug)]
66
pub struct OrderExecuted {
7-
pub auction: Pubkey,
7+
pub fast_vaa_hash: [u8; 32],
88
pub vaa: Pubkey,
99
pub source_chain: u16,
1010
pub target_protocol: MessageProtocol,

solana/programs/matching-engine/src/processor/auction/execute_fast_order/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ fn handle_execute_fast_order<'info>(
214214
execute_penalty: if penalized { penalty.into() } else { None },
215215
},
216216
OrderExecuted {
217-
auction: auction.key(),
217+
fast_vaa_hash: auction.vaa_hash,
218218
vaa: fast_vaa.key(),
219219
source_chain: auction_info.source_chain,
220220
target_protocol: auction.target_protocol,

solana/programs/matching-engine/src/processor/auction/offer/improve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub fn improve_offer(ctx: Context<ImproveOffer>, offer_price: u64) -> Result<()>
137137
// Emit event for auction participants to listen to.
138138
emit_cpi!(crate::utils::log_emit(crate::events::AuctionUpdated {
139139
config_id: info.config_id,
140-
auction: auction.key(),
140+
fast_vaa_hash: auction.vaa_hash,
141141
vaa: Default::default(),
142142
source_chain: info.source_chain,
143143
target_protocol: auction.target_protocol,

solana/programs/matching-engine/src/processor/auction/offer/place_initial/cctp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub fn place_initial_offer_cctp(
169169
// Emit event for auction participants to listen to.
170170
emit_cpi!(crate::utils::log_emit(crate::events::AuctionUpdated {
171171
config_id: info.config_id,
172-
auction: ctx.accounts.auction.key(),
172+
fast_vaa_hash: ctx.accounts.auction.vaa_hash,
173173
vaa: ctx.accounts.fast_order_path.fast_vaa.key().into(),
174174
source_chain: info.source_chain,
175175
target_protocol: ctx.accounts.auction.target_protocol,

solana/programs/matching-engine/src/processor/auction/settle/complete.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ fn handle_settle_auction_complete(
249249
};
250250

251251
emit_cpi!(crate::events::AuctionSettled {
252-
auction: ctx.accounts.auction.key(),
252+
fast_vaa_hash: ctx.accounts.auction.vaa_hash,
253253
best_offer_token: settled_best_offer_result,
254254
base_fee_token: settled_base_fee_result,
255255
with_execute: Default::default(),

0 commit comments

Comments
 (0)