Skip to content

Commit

Permalink
program: whitelist lighthouse for end of tx (#1429)
Browse files Browse the repository at this point in the history
* program: whitelist lighthouse for end of tx

* cargo fmt --

* CHANGELOG
  • Loading branch information
crispheaney authored Jan 20, 2025
1 parent d15ff6c commit 1ab525d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- program: allow lighthouse at end of swap ([#1429](https://github.com/drift-labs/protocol-v2/pull/1429))

### Fixes

### Breaking
Expand Down
5 changes: 5 additions & 0 deletions programs/drift/src/ids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,8 @@ pub mod swift_server {
#[cfg(feature = "anchor-test")]
declare_id!("DpaEdAPW3ZX67fnczT14AoX12Lx9VMkxvtT81nCHy3Nv");
}

pub mod lighthouse {
use solana_program::declare_id;
declare_id!("L2TExMFKdjpN9kozasaurPirfHy9P8sbXoAN1qA3S95");
}
7 changes: 6 additions & 1 deletion programs/drift/src/instructions/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ use crate::controller::spot_position::{
};
use crate::error::ErrorCode;
use crate::ids::{
jupiter_mainnet_3, jupiter_mainnet_4, jupiter_mainnet_6, marinade_mainnet, serum_program,
jupiter_mainnet_3, jupiter_mainnet_4, jupiter_mainnet_6, lighthouse, marinade_mainnet,
serum_program,
};
use crate::instructions::constraints::*;
use crate::instructions::optional_accounts::{
Expand Down Expand Up @@ -2683,6 +2684,10 @@ pub fn handle_begin_swap<'c: 'info, 'info>(
}
} else {
if found_end {
if ix.program_id == lighthouse::ID {
continue;
}

for meta in ix.accounts.iter() {
validate!(
meta.is_writable == false,
Expand Down

0 comments on commit 1ab525d

Please sign in to comment.