Skip to content

Commit

Permalink
Sort logic calls by nonce in orchestrator
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBolten committed May 3, 2022
1 parent 0ca9c09 commit 96109fd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions orchestrator/cosmos_gravity/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ pub async fn get_latest_logic_calls(
for call in calls {
out.push(LogicCall::from_proto(call)?);
}

// as these calls are expected to be in oldest -> newest order, but
// the chain does not provide them as such, we will sort using the
// invalidation nonces as keys such that for any given scope, calls will
// be processed in nonce order
out.sort_by_key(|call| call.invalidation_nonce);

Ok(out)
}

Expand Down

0 comments on commit 96109fd

Please sign in to comment.