From 3fc161bea4abef4e67b3f46d78401b26a77a47ba Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Thu, 14 Jul 2022 18:39:57 +0100 Subject: [PATCH] Fix flaky message kitchen sink test (#26624) --- sdk/program/src/pubkey.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/program/src/pubkey.rs b/sdk/program/src/pubkey.rs index f31579fd4f..a8992c3672 100644 --- a/sdk/program/src/pubkey.rs +++ b/sdk/program/src/pubkey.rs @@ -176,7 +176,9 @@ impl Pubkey { let mut b = [0u8; 32]; let i = I.fetch_add(1); - b[0..8].copy_from_slice(&i.to_le_bytes()); + // use big endian representation to ensure that recent unique pubkeys + // are always greater than less recent unique pubkeys + b[0..8].copy_from_slice(&i.to_be_bytes()); Self::new(&b) }