From eb93b6f1a8ab5d0a39300bf15cb46db979697fbb Mon Sep 17 00:00:00 2001 From: YairVaknin-starkware Date: Mon, 14 Oct 2024 13:22:01 +0300 Subject: [PATCH] Sort_ecdsa_and_mod_builtins_private_inputs_by_idx --- vm/src/vm/runners/builtin_runner/modulo.rs | 2 ++ vm/src/vm/runners/builtin_runner/signature.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/vm/src/vm/runners/builtin_runner/modulo.rs b/vm/src/vm/runners/builtin_runner/modulo.rs index 3339c0b562..085e3549b6 100644 --- a/vm/src/vm/runners/builtin_runner/modulo.rs +++ b/vm/src/vm/runners/builtin_runner/modulo.rs @@ -263,6 +263,8 @@ impl ModBuiltinRunner { }); } + instances.sort_by_key(|input| input.index); + vec![PrivateInput::Mod(ModInput { instances, zero_value_address: relocation_table diff --git a/vm/src/vm/runners/builtin_runner/signature.rs b/vm/src/vm/runners/builtin_runner/signature.rs index 6e94206ef3..ace87aef60 100644 --- a/vm/src/vm/runners/builtin_runner/signature.rs +++ b/vm/src/vm/runners/builtin_runner/signature.rs @@ -238,6 +238,10 @@ impl SignatureBuiltinRunner { })) } } + private_inputs.sort_by_key(|input| match input { + PrivateInput::Signature(sig) => sig.index, + _ => unreachable!(), + }); private_inputs } }