From 20aea2ebcf2b5964c062feea577aa608ad0e5bd8 Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Tue, 26 Sep 2023 08:54:01 -0500 Subject: [PATCH] sdk/js: Redeem on Algorand dynamic cost budget fix Addresses #2345 --- sdk/js/src/algorand/Algorand.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sdk/js/src/algorand/Algorand.ts b/sdk/js/src/algorand/Algorand.ts index be8f50928..b18f53a20 100644 --- a/sdk/js/src/algorand/Algorand.ts +++ b/sdk/js/src/algorand/Algorand.ts @@ -25,7 +25,6 @@ import { BigNumber } from "ethers"; import { keccak256 } from "ethers/lib/utils"; import { getEmitterAddressAlgorand } from "../bridge"; import { - ChainId, CHAIN_ID_ALGORAND, hexToUint8Array, textToHexString, @@ -45,7 +44,7 @@ const BITS_PER_BYTE: number = 8; export const BITS_PER_KEY: number = MAX_BYTES_PER_KEY * BITS_PER_BYTE; const MAX_BYTES: number = MAX_BYTES_PER_KEY * MAX_KEYS; export const MAX_BITS: number = BITS_PER_BYTE * MAX_BYTES; -const MAX_SIGS_PER_TXN: number = 9; +const MAX_SIGS_PER_TXN: number = 6; const ALGO_VERIFY_HASH = "EZATROXX2HISIRZDRGXW4LRQ46Z6IUJYYIHU3PJGP7P5IQDPKVX42N767A"; @@ -614,12 +613,12 @@ export async function submitVAAHeader( .do(); // We don't pass the entire payload in but instead just pass it pre digested. This gets around size - // limitations with lsigs AND reduces the cost of the entire operation on a conjested network by reducing the + // limitations with lsigs AND reduces the cost of the entire operation on a congested network by reducing the // bytes passed into the transaction // This is a 2 pass digest const digest = keccak256(keccak256(parsedVAA.digest)).slice(2); - // How many signatures can we process in a single txn... we can do 9! + // How many signatures can we process in a single txn... we can do 6! // There are likely upwards of 19 signatures. So, we ned to split things up const numSigs: number = parsedVAA.siglen; let numTxns: number = Math.floor(numSigs / MAX_SIGS_PER_TXN) + 1;