Skip to content

Commit

Permalink
NDEV-3380 don't interrupt solana call with SyncedExecutorState
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-yazkov committed Nov 8, 2024
1 parent 7efb03a commit a762bec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions evm_loader/program/src/evm/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use solana_program::{

#[maybe_async(?Send)]
pub trait Database: LogCollector {
fn is_synced_state(&self) -> bool;
fn program_id(&self) -> &Pubkey;
fn operator(&self) -> Pubkey;
fn chain_id_to_token(&self, chain_id: u64) -> Pubkey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ async fn execute_external_instruction<State: Database>(
#[cfg(not(target_os = "solana"))]
log::info!("instruction: {:?}", instruction);

if context.interrupt_solana_call {
if !state.is_synced_state() && context.interrupt_solana_call {
context.interrupt_solana_call = false;
return Err(Error::InterruptedCall);
}
Expand Down
3 changes: 3 additions & 0 deletions evm_loader/program/src/executor/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ impl<B: AccountStorage> LogCollector for ExecutorState<'_, B> {

#[maybe_async(?Send)]
impl<'a, B: AccountStorage> Database for ExecutorState<'a, B> {
fn is_synced_state(&self) -> bool {
false
}
fn program_id(&self) -> &Pubkey {
self.backend.program_id()
}
Expand Down
3 changes: 3 additions & 0 deletions evm_loader/program/src/executor/synced_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ impl<B: AccountStorage> LogCollector for SyncedExecutorState<'_, B> {

#[maybe_async(?Send)]
impl<'a, B: SyncedAccountStorage> Database for SyncedExecutorState<'a, B> {
fn is_synced_state(&self) -> bool {
true
}
fn program_id(&self) -> &Pubkey {
self.backend.program_id()
}
Expand Down

0 comments on commit a762bec

Please sign in to comment.