Skip to content

Commit

Permalink
Update memory ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-ch committed Jan 13, 2025
1 parent 9f93bcb commit 5eeba9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ where
.filter_costs_that_have_values_greater_than_l2_block_height(da_block_costs)?;
tracing::debug!(
"the latest l2 height is: {:?}",
self.latest_l2_height.load(Ordering::SeqCst)
self.latest_l2_height.load(Ordering::Acquire)
);
for da_block_costs in filtered_block_costs {
tracing::debug!("Sending block costs: {:?}", da_block_costs);
Expand All @@ -128,7 +128,7 @@ where
&self,
da_block_costs: Vec<DaBlockCosts>,
) -> Result<impl Iterator<Item = DaBlockCosts>> {
let latest_l2_height = self.latest_l2_height.load(Ordering::SeqCst);
let latest_l2_height = self.latest_l2_height.load(Ordering::Acquire);
let iter = da_block_costs.into_iter().filter(move |da_block_costs| {
let end = *da_block_costs.l2_blocks.end();
end < latest_l2_height
Expand Down
2 changes: 1 addition & 1 deletion crates/services/gas_price_service/src/v1/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ where
match block {
BlockInfo::GenesisBlock => {}
BlockInfo::Block { height, .. } => {
self.latest_l2_block.store(height, Ordering::SeqCst);
self.latest_l2_block.store(height, Ordering::Release);
}
}
Ok(())
Expand Down

0 comments on commit 5eeba9e

Please sign in to comment.