Skip to content

Commit ff67963

Browse files
committed
perf: set the elf id only once
1 parent 27cf991 commit ff67963

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

crates/executor/host/src/full_executor.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,7 @@ pub trait BlockExecutor<C: ExecutorComponents> {
9595
hooks.on_proving_start(client_input.current_block.number).await?;
9696
let client = self.client();
9797
let pk = self.pk();
98-
99-
let elf_id = if ELF_ID.get().is_none() {
100-
ELF_ID.set(hex::encode(Sha256::digest(&pk.elf))).unwrap();
101-
None
102-
} else {
103-
Some(ELF_ID.get().unwrap().clone())
104-
};
98+
let elf_id = Some(ELF_ID.get().unwrap().clone());
10599
info!("elf id: {:?}", elf_id);
106100

107101
let proof_with_cycles = task::spawn_blocking(move || {
@@ -233,6 +227,8 @@ where
233227
})
234228
.await?;
235229

230+
ELF_ID.set(hex::encode(Sha256::digest(&pk.elf))).unwrap();
231+
236232
Ok(Self {
237233
provider,
238234
debug_provider,

0 commit comments

Comments
 (0)