diff --git a/contracts/package.json b/contracts/package.json index 5b3d6faa7..07f3d0a51 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -2,7 +2,7 @@ "dependencies": { "@chainlink/solana-sdk": "../ts", "@project-serum/anchor": "^0.25.0", - "@solana/spl-token": "^0.2.0", + "@solana/spl-token": "^0.3.5", "@solana/web3.js": "^1.50.1", "@types/chai": "^4.2.22", "@types/mocha": "^9.0.0", diff --git a/contracts/programs/ocr2/src/context.rs b/contracts/programs/ocr2/src/context.rs index bef86fced..811c2240d 100644 --- a/contracts/programs/ocr2/src/context.rs +++ b/contracts/programs/ocr2/src/context.rs @@ -127,6 +127,9 @@ pub struct Transmit<'info> { pub store_program: Program<'info, Store>, /// CHECK: PDA from the aggregator state, validated by the store program pub store_authority: AccountInfo<'info>, + // TODO: stop using remaining_accounts once nodes update + // /// CHECK: Validated by sysvar::instructions::load_current_index_checked/load_instruction_at_checked + // pub instructions: AccountInfo<'info>, } #[derive(Accounts)] diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index 1017e973a..0b70af0eb 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -716,8 +716,11 @@ fn transmit_impl<'info>(ctx: Context>, data: &[u8]) -> Result<() state.config.latest_transmitter = ctx.accounts.transmitter.key(); // calculate and pay reimbursement - let reimbursement_gjuels = - calculate_reimbursement_gjuels(report.juels_per_lamport, signature_count)?; // gjuels + let reimbursement_gjuels = calculate_reimbursement_gjuels( + report.juels_per_lamport, + signature_count, + ctx.remaining_accounts.first(), + )?; let amount_gjuels = reimbursement_gjuels .saturating_add(u64::from(state.config.billing.transmission_payment_gjuels)); state.oracles[oracle_idx].payment_gjuels = state.oracles[oracle_idx] @@ -800,11 +803,34 @@ impl Report { } } -fn calculate_reimbursement_gjuels(juels_per_lamport: u64, _signature_count: usize) -> Result { +fn calculate_reimbursement_gjuels( + juels_per_lamport: u64, + signature_count: usize, + instructions_sysvar: Option<&AccountInfo<'_>>, +) -> Result { const SIGNERS: u64 = 1; + const MICRO: u64 = 10u64.pow(6); const GIGA: u128 = 10u128.pow(9); const LAMPORTS_PER_SIGNATURE: u64 = 5_000; // constant, originally retrieved from deprecated sysvar fees - let lamports = LAMPORTS_PER_SIGNATURE * SIGNERS; + let mut lamports = LAMPORTS_PER_SIGNATURE * SIGNERS; + + // if a compute unit price is set then we also need to + if let Some(sysvar) = instructions_sysvar { + if let Some(compute_unit_price_micro_lamports) = compute_unit_price(sysvar)? { + // 25k per signature, plus ~21k for the rest + let exec_units = 25_000 * signature_count as u64 + 21_000; + // TODO: std::cmp::min(compute_unit_price_micro_lamports, config.max_compute_unit_price) + + // https://github.com/solana-labs/solana/blob/090e11210aa7222d8295610a6ccac4acda711bb9/program-runtime/src/prioritization_fee.rs#L34-L38 + let micro_lamport_fee = exec_units.saturating_mul(compute_unit_price_micro_lamports); + let fee = micro_lamport_fee + .saturating_add(MICRO.saturating_sub(1)) + .saturating_div(MICRO); + + lamports = lamports.saturating_add(fee); + }; + } + let juels = u128::from(lamports) * u128::from(juels_per_lamport); let gjuels = juels / GIGA; // return value as gjuels @@ -812,6 +838,43 @@ fn calculate_reimbursement_gjuels(juels_per_lamport: u64, _signature_count: usiz Ok(gjuels.try_into().unwrap_or(u64::MAX)) } +pub mod compute_budget { + crate::declare_id!("ComputeBudget111111111111111111111111111111"); +} + +fn compute_unit_price(instruction_sysvar: &AccountInfo<'_>) -> Result> { + use anchor_lang::solana_program::sysvar; + // look at sysvar instructions + let current_instruction = sysvar::instructions::load_current_index_checked(instruction_sysvar)?; + + // if we can't find unit price return None and skip this part of calc + if current_instruction == 0 { + return Ok(None); + } + + // find ComputeBudgetInstruction::SetComputeUnitPrice() + let compute_budget_ix = sysvar::instructions::load_instruction_at_checked( + (current_instruction as usize) - 1, + instruction_sysvar, + )?; + + require!( + compute_budget_ix.program_id == compute_budget::ID, + InvalidInput + ); + + require!(compute_budget_ix.data[0] == 3, InvalidInput); // SetComputeUnitPrice index + + // u8, u64 + require!(compute_budget_ix.data.len() == 9, InvalidInput); // <-- + let unit_price_micro_lamports = + u64::from_le_bytes(compute_budget_ix.data[1..1 + 8].try_into().unwrap()); + + // parse out execution unit price + + Ok(Some(unit_price_micro_lamports)) +} + fn calculate_owed_payment_gjuels( config: &Billing, oracle: &Oracle, diff --git a/contracts/tests/ocr2.spec.ts b/contracts/tests/ocr2.spec.ts index 07f285c6e..aadf90457 100644 --- a/contracts/tests/ocr2.spec.ts +++ b/contracts/tests/ocr2.spec.ts @@ -7,6 +7,8 @@ import { Keypair, Transaction, TransactionInstruction, + SYSVAR_INSTRUCTIONS_PUBKEY, + ComputeBudgetProgram, } from "@solana/web3.js"; import { createMint, @@ -130,6 +132,7 @@ describe("ocr2", async () => { epoch: number, round: number, answer: BN, + computeUnitPrice: number = 0, juels: Buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 2]) // juels per lamport (2) ): Promise => { let account = await program.account.state.fetch(state.publicKey); @@ -206,6 +209,9 @@ describe("ocr2", async () => { const transmitter = oracles[0].transmitter; const tx = new Transaction(); + if (computeUnitPrice > 0) { + tx.add(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: computeUnitPrice })) + } tx.add( new TransactionInstruction({ programId: anchor.translateAddress(program.programId), @@ -223,6 +229,7 @@ describe("ocr2", async () => { isSigner: false, }, { pubkey: storeAuthority, isWritable: false, isSigner: false }, + { pubkey: SYSVAR_INSTRUCTIONS_PUBKEY, isWritable: false, isSigner: false }, ], data: Buffer.concat([ Buffer.from([storeNonce]), @@ -247,13 +254,14 @@ describe("ocr2", async () => { }; it("Funds the payer", async () => { + await provider.connection.confirmTransaction( await provider.connection.requestAirdrop( fromWallet.publicKey, - LAMPORTS_PER_SOL - ); + LAMPORTS_PER_SOL * 1000 + ), "confirmed"); await provider.connection.confirmTransaction( - await provider.connection.requestAirdrop(payer.publicKey, 10000000000), + await provider.connection.requestAirdrop(payer.publicKey, LAMPORTS_PER_SOL * 1000), "confirmed" ); }); @@ -861,6 +869,7 @@ describe("ocr2", async () => { }, ], ]); + it("Can call query", async () => { let round = await query( feed.publicKey, @@ -981,22 +990,81 @@ describe("ocr2", async () => { } }); + it("Transmit reimburses for setComputeUnitPrice", async () => { + const transmitter = oracles[0].transmitter.publicKey; + + let account = await program.account.state.fetch(state.publicKey); + let currentOracles = account.oracles.xs.slice(0, account.oracles.len); + // get the transmitter + let i = currentOracles.findIndex((o) => o.transmitter.equals(transmitter)); + let oracle = currentOracles[i]; + console.log(oracle); + let before = oracle.paymentGjuels; + + let computePriceMicroLamports = 10; + let juelsPerLamport = Buffer.from([0, 0, 0, 0, 59, 154, 202, 0]); // 1 gjuel (to_be_bytes) + let tx = await transmit( + feed.publicKey, + rounds + 1, + rounds + 1, + new BN(rounds + 2), + computePriceMicroLamports, + juelsPerLamport, + ); + await provider.connection.confirmTransaction(tx); + let t = await provider.connection.getTransaction(tx, { commitment: "confirmed" }); + console.log(t.meta.logMessages); // 195_785/195_997 + account = await program.account.state.fetch(state.publicKey, 'confirmed'); + currentOracles = account.oracles.xs.slice(0, account.oracles.len); + // get the transmitter + oracle = currentOracles[i]; + let after = oracle.paymentGjuels; + + let payment = after.sub(before).toNumber(); + let execUnits = (25_000 * (f+1) + 21_000); + let computeUnitCostLamports = execUnits * computePriceMicroLamports / Math.pow(10, 6); + let lamportsPerSignature = 5000; + let signers = 1; + let computeUnitCostGjuels = Math.ceil((computeUnitCostLamports + lamportsPerSignature * signers) * 1); // 1 lamport = 1 gjuel + assert.equal(payment, transmissionPayment + computeUnitCostGjuels); + + // payOracles to clean up the payment state for the next test + let payees = currentOracles.map((oracle) => { + return { pubkey: oracle.payee, isWritable: true, isSigner: false }; + }); + tx = await program.rpc.payOracles({ + accounts: { + state: state.publicKey, + authority: owner.publicKey, + accessController: billingAccessController.publicKey, + tokenReceiver: recipientTokenAccount.address, + tokenVault: tokenVault, + vaultAuthority: vaultAuthority, + tokenProgram: TOKEN_PROGRAM_ID, + }, + remainingAccounts: payees, + }); + await provider.connection.confirmTransaction(tx); + }); + it("Transmit does not fail on juelsPerFeecoin edge cases", async () => { // zero value u64 juelsPerFeecoin await transmit( feed.publicKey, - rounds + 1, - rounds + 1, + rounds + 2, + rounds + 2, new BN(rounds + 1), + 0, Buffer.from([0, 0, 0, 0, 0, 0, 0, 0]) ); // max value u64 juelsPerFeecoin await transmit( feed.publicKey, - rounds + 2, - rounds + 2, + rounds + 3, + rounds + 3, new BN(rounds + 2), + 0, Buffer.from([127, 127, 127, 127, 127, 127, 127, 127]) ); }); @@ -1216,4 +1284,5 @@ describe("ocr2", async () => { ); assert.equal(new BN(round.answer, 10, "le").toNumber(), 100); }); + }); diff --git a/contracts/yarn.lock b/contracts/yarn.lock index 0f7a7d964..5386cde3e 100644 --- a/contracts/yarn.lock +++ b/contracts/yarn.lock @@ -3,9 +3,9 @@ "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" - integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.0.tgz#22b11c037b094d27a8a2504ea4dcff00f50e2259" + integrity sha512-eR8Lo9hnDS7tqkO7NsV+mKvCmv5boaXFSZ70DnfhcgiEne8hv9oCEd36Klw74EtizEqLsy4YnW8UWwpBVolHZA== dependencies: regenerator-runtime "^0.13.4" @@ -15,38 +15,41 @@ "@project-serum/anchor" "^0.24.2" "@solana/web3.js" "^1.50.1" -"@ethersproject/bytes@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" - integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== +"@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== dependencies: - "@ethersproject/logger" "^5.6.0" + "@ethersproject/logger" "^5.7.0" -"@ethersproject/logger@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" - integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== +"@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== "@ethersproject/sha2@^5.5.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.6.1.tgz#211f14d3f5da5301c8972a8827770b6fd3e51656" - integrity sha512-5K2GyqcW7G4Yo3uenHegbXRPDgARpWUiXc6RiF7b6i/HXUoWlb7uCARh7BAHg7/qT/Q5ydofNwiZcim9qpjB6g== + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" + integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" hash.js "1.1.7" -"@hapi/hoek@^9.0.0": - version "9.3.0" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" - integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== +"@noble/ed25519@^1.7.0": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.1.tgz#6899660f6fbb97798a6fbd227227c4589a454724" + integrity sha512-Rk4SkJFaXZiznFyC/t77Q0NKS4FL7TLJJsVG2V2oiEq3kJVeTdxysEe/yRWSpnWMe808XRDJ+VFh5pt/FN5plw== -"@hapi/topo@^5.0.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" - integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== - dependencies: - "@hapi/hoek" "^9.0.0" +"@noble/hashes@^1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.3.tgz#360afc77610e0a61f3417e497dcf36862e4f8111" + integrity sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A== + +"@noble/secp256k1@^1.6.3": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.0.tgz#d15357f7c227e751d90aa06b05a0e5cf993ba8c1" + integrity sha512-kbacwGSsH/CTout0ZnZWxnW1B+jH/7r/WAAKLBtrRJ/+CUH7lgmQzl3GTrQua3SGKWNSDsS6lmjnDpIJ5Dxyaw== "@project-serum/anchor@^0.24.2": version "0.24.2" @@ -97,23 +100,6 @@ bn.js "^5.1.2" buffer-layout "^1.2.0" -"@sideway/address@^4.1.3": - version "4.1.4" - resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" - integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw== - dependencies: - "@hapi/hoek" "^9.0.0" - -"@sideway/formula@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.0.tgz#fe158aee32e6bd5de85044be615bc08478a0a13c" - integrity sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg== - -"@sideway/pinpoint@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" - integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== - "@solana/buffer-layout-utils@^0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz#b45a6cab3293a2eb7597cceb474f229889d875ca" @@ -131,17 +117,16 @@ dependencies: buffer "~6.0.3" -"@solana/spl-token@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.2.0.tgz#329bb6babb5de0f9c40035ddb1657f01a8347acd" - integrity sha512-RWcn31OXtdqIxmkzQfB2R+WpsJOVS6rKuvpxJFjvik2LyODd+WN58ZP3Rpjpro03fscGAkzlFuP3r42doRJgyQ== +"@solana/spl-token@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.3.5.tgz#cabf9f92d755589420b46e457b9b10a879e755aa" + integrity sha512-0bGC6n415lGjKu02gkLOIpP1wzndSP0SHwN9PefJ+wKAhmfU1rl3AV1Pa41uap2kzSCD6F9642ngNO8KXPvh/g== dependencies: "@solana/buffer-layout" "^4.0.0" "@solana/buffer-layout-utils" "^0.2.0" - "@solana/web3.js" "^1.32.0" - start-server-and-test "^1.14.0" + buffer "^6.0.3" -"@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.50.1": +"@solana/web3.js@^1.32.0": version "1.50.1" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.50.1.tgz#dae726a06267d1bcd88b1e3cd8ae44c709302dcf" integrity sha512-1l9N/nS8pJEA2YibNT8wa072718O0/A1eKWE0+pdWC5wDGQgBNxZSLuv7Cq5Dcn46WsZ5J5ZstK89q8J/ZZaQA== @@ -164,10 +149,31 @@ superstruct "^0.14.2" tweetnacl "^1.0.0" +"@solana/web3.js@^1.36.0", "@solana/web3.js@^1.50.1": + version "1.63.1" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.63.1.tgz#88a19a17f5f4aada73ad70a94044c1067cab2b4d" + integrity sha512-wgEdGVK5FTS2zENxbcGSvKpGZ0jDS6BUdGu8Gn6ns0CzgJkK83u4ip3THSnBPEQ5i/jrqukg998BwV1H67+qiQ== + dependencies: + "@babel/runtime" "^7.12.5" + "@noble/ed25519" "^1.7.0" + "@noble/hashes" "^1.1.2" + "@noble/secp256k1" "^1.6.3" + "@solana/buffer-layout" "^4.0.0" + bigint-buffer "^1.1.5" + bn.js "^5.0.0" + borsh "^0.7.0" + bs58 "^4.0.1" + buffer "6.0.1" + fast-stable-stringify "^1.0.0" + jayson "^3.4.4" + node-fetch "2" + rpc-websockets "^7.5.0" + superstruct "^0.14.2" + "@types/chai@^4.2.22": - version "4.3.0" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.0.tgz#23509ebc1fa32f1b4d50d6a66c4032d5b8eaabdc" - integrity sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw== + version "4.3.3" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.3.tgz#3c90752792660c4b562ad73b3fbd68bf3bc7ae07" + integrity sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g== "@types/connect@^3.4.33": version "3.4.35" @@ -176,34 +182,20 @@ dependencies: "@types/node" "*" -"@types/express-serve-static-core@^4.17.9": - version "4.17.30" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.30.tgz#0f2f99617fa8f9696170c46152ccf7500b34ac04" - integrity sha512-gstzbTWro2/nFed1WXtf+TtrpwxH7Ggs4RLYTLbeVgIkUQOI3WG/JKjgeOU1zXDvezllupjrf8OPIdvTbIaVOQ== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/lodash@^4.14.159": - version "4.14.182" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" - integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== - "@types/mocha@^9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.0.0.tgz#3205bcd15ada9bc681ac20bef64e9e6df88fd297" - integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== + version "9.1.1" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" + integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== "@types/node@*": - version "18.6.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.2.tgz#ffc5f0f099d27887c8d9067b54e55090fcd54126" - integrity sha512-KcfkBq9H4PI6Vpu5B/KoPeuVDAbmi+2mDBqGPGUgoL7yXQtcWGu2vJWmmRkneWK3Rh0nIAX192Aa87AqKHYChQ== + version "18.8.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.8.2.tgz#17d42c6322d917764dd3d2d3a10d7884925de067" + integrity sha512-cRMwIgdDN43GO4xMWAfJAecYn8wV4JbsOGHNfNUIDiuYkUYAR5ec4Rj7IO2SAhFPEfpPtLtUTbbny/TCT7aDwA== "@types/node@^12.12.54": version "12.20.55" @@ -211,9 +203,9 @@ integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== "@types/node@^14.14.37": - version "14.18.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.5.tgz#0dd636fe7b2c6055cbed0d4ca3b7fb540f130a96" - integrity sha512-LMy+vDDcQR48EZdEx5wRX1q/sEl6NdGuHXPnfeL8ixkwCOSZ2qnIyIZmcCbdX0MeRqHhAcHmX+haCbrS8Run+A== + version "14.18.31" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.31.tgz#4b873dea3122e71af4f77e65ec5841397ff254d3" + integrity sha512-vQAnaReSQkEDa8uwAyQby8bYGKu84R/deEc6mg5T8fX6gzCn8QW6rziSgsti1fNvsrswKUKPnVTi7uoB+u62Mw== "@types/pbkdf2@^3.0.0": version "3.1.0" @@ -222,16 +214,6 @@ dependencies: "@types/node" "*" -"@types/qs@*": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - -"@types/range-parser@*": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== - "@types/secp256k1@^4.0.1", "@types/secp256k1@^4.0.3": version "4.0.3" resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" @@ -299,13 +281,6 @@ assertion-error@^1.1.0: resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== -axios@^0.21.1: - version "0.21.4" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" - integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== - dependencies: - follow-redirects "^1.14.0" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -352,26 +327,16 @@ blakejs@^1.1.0: resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702" integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== -bluebird@3.7.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.0.0, bn.js@^5.1.2: +bn.js@^5.0.0, bn.js@^5.1.2, bn.js@^5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -bn.js@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - borsh@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a" @@ -465,7 +430,7 @@ buffer@^5.4.3: base64-js "^1.3.1" ieee754 "^1.1.13" -buffer@~6.0.3: +buffer@^6.0.3, buffer@~6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== @@ -486,19 +451,20 @@ camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== camelcase@^6.0.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" - integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== chai@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" - integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== + version "4.3.6" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.6.tgz#ffe4ba2d9fa9d6680cc0b370adae709ec9011e9c" + integrity sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q== dependencies: assertion-error "^1.1.0" check-error "^1.0.2" deep-eql "^3.0.1" get-func-name "^2.0.0" + loupe "^2.3.1" pathval "^1.1.1" type-detect "^4.0.5" @@ -513,17 +479,12 @@ chalk@^4.1.0: check-error@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - -check-more-types@2.24.0: - version "2.24.0" - resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" - integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== + integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== -chokidar@3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== +chokidar@3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" braces "~3.0.2" @@ -572,7 +533,7 @@ commander@^2.20.3: concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" @@ -604,24 +565,15 @@ cross-fetch@^3.1.5: dependencies: node-fetch "2.6.7" -cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - crypto-hash@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== -debug@4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== +debug@4.3.3: + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== dependencies: ms "2.1.2" @@ -660,11 +612,6 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" -duplexer@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" - integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== - elliptic@^6.5.2, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" @@ -726,19 +673,6 @@ ethereum-cryptography@^0.1.3: secp256k1 "^4.0.1" setimmediate "^1.0.5" -event-stream@=3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" - integrity sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g== - dependencies: - duplexer "~0.1.1" - from "~0" - map-stream "~0.1.0" - pause-stream "0.0.11" - split "0.3" - stream-combiner "~0.0.4" - through "~2.3.1" - eventemitter3@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -752,21 +686,6 @@ evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -execa@5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - eyes@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" @@ -802,20 +721,10 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -follow-redirects@^1.14.0: - version "1.15.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" - integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== - -from@~0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" - integrity sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g== - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.3.2: version "2.3.2" @@ -830,12 +739,7 @@ get-caller-file@^2.0.5: get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= - -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== glob-parent@~5.1.2: version "5.1.2" @@ -844,10 +748,10 @@ glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob@7.1.7: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -897,11 +801,6 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - ieee754@^1.1.13, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" @@ -910,7 +809,7 @@ ieee754@^1.1.13, ieee754@^1.2.1: inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" wrappy "1" @@ -930,7 +829,7 @@ is-binary-path@~2.1.0: is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^3.0.0: version "3.0.0" @@ -954,11 +853,6 @@ is-plain-obj@^2.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - is-unicode-supported@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" @@ -967,7 +861,7 @@ is-unicode-supported@^0.1.0: isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== isomorphic-ws@^4.0.1: version "4.0.1" @@ -975,13 +869,11 @@ isomorphic-ws@^4.0.1: integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== jayson@^3.4.4: - version "3.6.6" - resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.6.6.tgz#189984f624e398f831bd2be8e8c80eb3abf764a1" - integrity sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ== + version "3.7.0" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.7.0.tgz#b735b12d06d348639ae8230d7a1e2916cb078f25" + integrity sha512-tfy39KJMrrXJ+mFcMpxwBvFDetS8LAID93+rycFglIQM4kl3uNR3W4lBLE/FFhsoUCEox5Dt2adVpDm/XtebbQ== dependencies: "@types/connect" "^3.4.33" - "@types/express-serve-static-core" "^4.17.9" - "@types/lodash" "^4.14.159" "@types/node" "^12.12.54" "@types/ws" "^7.4.4" JSONStream "^1.3.5" @@ -995,17 +887,6 @@ jayson@^3.4.4: uuid "^8.3.2" ws "^7.4.5" -joi@^17.4.0: - version "17.6.0" - resolved "https://registry.yarnpkg.com/joi/-/joi-17.6.0.tgz#0bb54f2f006c09a96e75ce687957bd04290054b2" - integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw== - dependencies: - "@hapi/hoek" "^9.0.0" - "@hapi/topo" "^5.0.0" - "@sideway/address" "^4.1.3" - "@sideway/formula" "^3.0.0" - "@sideway/pinpoint" "^2.0.0" - js-sha256@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" @@ -1049,11 +930,6 @@ keccak@^3.0.0: node-gyp-build "^4.2.0" readable-stream "^3.6.0" -lazy-ass@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" - integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== - locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" @@ -1061,7 +937,7 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -lodash@^4.17.20, lodash@^4.17.21: +lodash@^4.17.20: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -1074,6 +950,13 @@ log-symbols@4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" +loupe@^2.3.1: + version "2.3.4" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.4.tgz#7e0b9bffc76f148f9be769cb1321d3dcf3cb25f3" + integrity sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ== + dependencies: + get-func-name "^2.0.0" + lower-case@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" @@ -1086,11 +969,6 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -map-stream@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" - integrity sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g== - md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -1100,16 +978,6 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -1120,10 +988,17 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== +minimatch@4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-4.2.1.tgz#40d9d511a46bdc4e563c22c3080cde9c0d8299b4" + integrity sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^3.0.4: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" @@ -1140,31 +1015,31 @@ mkdirp@^0.5.1: minimist "^1.2.5" mocha@^9.0.0: - version "9.1.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.1.3.tgz#8a623be6b323810493d8c8f6f7667440fa469fdb" - integrity sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw== + version "9.2.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.2.2.tgz#d70db46bdb93ca57402c809333e5a84977a88fb9" + integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== dependencies: "@ungap/promise-all-settled" "1.1.2" ansi-colors "4.1.1" browser-stdout "1.3.1" - chokidar "3.5.2" - debug "4.3.2" + chokidar "3.5.3" + debug "4.3.3" diff "5.0.0" escape-string-regexp "4.0.0" find-up "5.0.0" - glob "7.1.7" + glob "7.2.0" growl "1.10.5" he "1.2.0" js-yaml "4.1.0" log-symbols "4.1.0" - minimatch "3.0.4" + minimatch "4.2.1" ms "2.1.3" - nanoid "3.1.25" + nanoid "3.3.1" serialize-javascript "6.0.0" strip-json-comments "3.1.1" supports-color "8.1.1" which "2.0.2" - workerpool "6.1.5" + workerpool "6.2.0" yargs "16.2.0" yargs-parser "20.2.4" yargs-unparser "2.0.0" @@ -1179,10 +1054,10 @@ ms@2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanoid@3.1.25: - version "3.1.25" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" - integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== +nanoid@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" + integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== no-case@^3.0.4: version "3.0.4" @@ -1219,27 +1094,13 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -1267,25 +1128,13 @@ path-exists@^4.0.0: path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== pathval@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== -pause-stream@0.0.11: - version "0.0.11" - resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" - integrity sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A== - dependencies: - through "~2.3" - pbkdf2@^3.0.17: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" @@ -1298,21 +1147,14 @@ pbkdf2@^3.0.17: sha.js "^2.4.8" picomatch@^2.0.4, picomatch@^2.2.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== prettier@^2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" - integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== - -ps-tree@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" - integrity sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA== - dependencies: - event-stream "=3.3.4" + version "2.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" + integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== punycode@^2.1.1: version "2.1.1" @@ -1357,7 +1199,7 @@ regenerator-runtime@^0.13.4: require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" @@ -1380,13 +1222,6 @@ rpc-websockets@^7.5.0: bufferutil "^4.0.1" utf-8-validate "^5.0.2" -rxjs@^7.1.0: - version "7.5.6" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.6.tgz#0446577557862afd6903517ce7cae79ecb9662bc" - integrity sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw== - dependencies: - tslib "^2.1.0" - safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -1435,23 +1270,6 @@ sha.js@^2.4.0, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -signal-exit@^3.0.3: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - snake-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" @@ -1473,33 +1291,6 @@ source-map@^0.6.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -split@0.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" - integrity sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA== - dependencies: - through "2" - -start-server-and-test@^1.14.0: - version "1.14.0" - resolved "https://registry.yarnpkg.com/start-server-and-test/-/start-server-and-test-1.14.0.tgz#c57f04f73eac15dd51733b551d775b40837fdde3" - integrity sha512-on5ELuxO2K0t8EmNj9MtVlFqwBMxfWOhu4U7uZD1xccVpFlOQKR93CSe0u98iQzfNxRyaNTb/CdadbNllplTsw== - dependencies: - bluebird "3.7.2" - check-more-types "2.24.0" - debug "4.3.2" - execa "5.1.1" - lazy-ass "1.6.0" - ps-tree "1.2.0" - wait-on "6.0.0" - -stream-combiner@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" - integrity sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw== - dependencies: - duplexer "~0.1.1" - string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -1528,11 +1319,6 @@ strip-bom@^3.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - strip-json-comments@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -1567,7 +1353,7 @@ text-encoding-utf-8@^1.0.2: resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== -through@2, "through@>=2.2.7 <3", through@~2.3, through@~2.3.1: +"through@>=2.2.7 <3": version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== @@ -1622,7 +1408,7 @@ tsconfig-paths@^3.5.0: minimist "^1.2.0" strip-bom "^3.0.0" -tslib@^2.0.3, tslib@^2.1.0: +tslib@^2.0.3: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== @@ -1638,9 +1424,9 @@ type-detect@^4.0.0, type-detect@^4.0.5: integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== typescript@^4.5.4: - version "4.5.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" - integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== + version "4.8.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" + integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== utf-8-validate@^5.0.2: version "5.0.9" @@ -1659,17 +1445,6 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -wait-on@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-6.0.0.tgz#7e9bf8e3d7fe2daecbb7a570ac8ca41e9311c7e7" - integrity sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw== - dependencies: - axios "^0.21.1" - joi "^17.4.0" - lodash "^4.17.21" - minimist "^1.2.5" - rxjs "^7.1.0" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -1697,17 +1472,17 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which@2.0.2, which@^2.0.1: +which@2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" -workerpool@6.1.5: - version "6.1.5" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" - integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== +workerpool@6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" + integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== wrap-ansi@^7.0.0: version "7.0.0" @@ -1721,7 +1496,7 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== ws@^7.4.5: version "7.5.9" @@ -1729,9 +1504,9 @@ ws@^7.4.5: integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== ws@^8.5.0: - version "8.8.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.1.tgz#5dbad0feb7ade8ecc99b830c1d77c913d4955ff0" - integrity sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA== + version "8.9.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.9.0.tgz#2a994bb67144be1b53fe2d23c53c028adeb7f45e" + integrity sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg== y18n@^5.0.5: version "5.0.8" diff --git a/pkg/solana/config/config.go b/pkg/solana/config/config.go index e38878a09..193c25093 100644 --- a/pkg/solana/config/config.go +++ b/pkg/solana/config/config.go @@ -1,7 +1,9 @@ package config import ( + "fmt" "net/url" + "strings" "sync" "time" @@ -27,6 +29,13 @@ var defaultConfigSet = configSet{ SkipPreflight: true, // to enable or disable preflight checks Commitment: rpc.CommitmentConfirmed, MaxRetries: new(uint), // max number of retries, when nil - rpc node will do a reasonable number of retries + + // fee estimator + FeeEstimatorMode: "fixed", + MaxComputeUnitPrice: 1_000, + MinComputeUnitPrice: 0, + DefaultComputeUnitPrice: 0, + FeeBumpPeriod: 3 * time.Second, } type Config interface { @@ -41,6 +50,13 @@ type Config interface { Commitment() rpc.CommitmentType MaxRetries() *uint + // fee estimator + FeeEstimatorMode() string + MaxComputeUnitPrice() uint64 + MinComputeUnitPrice() uint64 + DefaultComputeUnitPrice() uint64 + FeeBumpPeriod() time.Duration + // Update sets new chain config values. Update(db.ChainCfg) } @@ -56,6 +72,12 @@ type configSet struct { SkipPreflight bool Commitment rpc.CommitmentType MaxRetries *uint + + FeeEstimatorMode string + MaxComputeUnitPrice uint64 + MinComputeUnitPrice uint64 + DefaultComputeUnitPrice uint64 + FeeBumpPeriod time.Duration } var _ Config = (*config)(nil) @@ -185,6 +207,55 @@ func (c *config) Commitment() rpc.CommitmentType { return c.defaults.Commitment } +func (c *config) FeeEstimatorMode() string { + c.chainMu.RLock() + ch := c.chain.FeeEstimatorMode + c.chainMu.RUnlock() + if ch.Valid { + return strings.ToLower(ch.String) + } + return c.defaults.FeeEstimatorMode +} + +func (c *config) MaxComputeUnitPrice() uint64 { + c.chainMu.RLock() + ch := c.chain.MaxComputeUnitPrice + c.chainMu.RUnlock() + if ch.Valid { + if ch.Int64 >= 0 { + return uint64(ch.Int64) + } + c.lggr.Warnf("Negative value provided for MaxComputeUnitPrice, falling back to default: %d", c.defaults.MaxComputeUnitPrice) + } + return c.defaults.MaxComputeUnitPrice +} + +func (c *config) MinComputeUnitPrice() uint64 { + c.chainMu.RLock() + ch := c.chain.MinComputeUnitPrice + c.chainMu.RUnlock() + if ch.Valid { + if ch.Int64 >= 0 { + return uint64(ch.Int64) + } + c.lggr.Warnf("Negative value provided for MinComputeUnitPrice, falling back to default: %d", c.defaults.MinComputeUnitPrice) + } + return c.defaults.MinComputeUnitPrice +} + +func (c *config) DefaultComputeUnitPrice() uint64 { + c.chainMu.RLock() + ch := c.chain.DefaultComputeUnitPrice + c.chainMu.RUnlock() + if ch.Valid { + if ch.Int64 >= 0 { + return uint64(ch.Int64) + } + c.lggr.Warnf("Negative value provided for DefaultComputeUnitPrice, falling back to default: %d", c.defaults.DefaultComputeUnitPrice) + } + return c.defaults.DefaultComputeUnitPrice +} + func (c *config) MaxRetries() *uint { c.chainMu.RLock() ch := c.chain.MaxRetries @@ -200,17 +271,32 @@ func (c *config) MaxRetries() *uint { return c.defaults.MaxRetries } +func (c *config) FeeBumpPeriod() time.Duration { + c.chainMu.RLock() + ch := c.chain.FeeBumpPeriod + c.chainMu.RUnlock() + if ch != nil { + return ch.Duration() + } + return c.defaults.FeeBumpPeriod +} + type Chain struct { - BalancePollPeriod *utils.Duration - ConfirmPollPeriod *utils.Duration - OCR2CachePollPeriod *utils.Duration - OCR2CacheTTL *utils.Duration - TxTimeout *utils.Duration - TxRetryTimeout *utils.Duration - TxConfirmTimeout *utils.Duration - SkipPreflight *bool - Commitment *string - MaxRetries *int64 + BalancePollPeriod *utils.Duration + ConfirmPollPeriod *utils.Duration + OCR2CachePollPeriod *utils.Duration + OCR2CacheTTL *utils.Duration + TxTimeout *utils.Duration + TxRetryTimeout *utils.Duration + TxConfirmTimeout *utils.Duration + SkipPreflight *bool + Commitment *string + MaxRetries *int64 + FeeEstimatorMode *string + MaxComputeUnitPrice *uint64 + MinComputeUnitPrice *uint64 + DefaultComputeUnitPrice *uint64 + FeeBumpPeriod *utils.Duration } func (c *Chain) SetFromDB(cfg *db.ChainCfg) error { @@ -248,6 +334,30 @@ func (c *Chain) SetFromDB(cfg *db.ChainCfg) error { if cfg.MaxRetries.Valid { c.MaxRetries = &cfg.MaxRetries.Int64 } + if cfg.FeeEstimatorMode.Valid { + c.FeeEstimatorMode = &cfg.FeeEstimatorMode.String + } + if cfg.MaxComputeUnitPrice.Valid { + if cfg.MaxComputeUnitPrice.Int64 < 0 { + return fmt.Errorf("MaxComputeUnitPrice is less than zero %d < 0", cfg.MaxComputeUnitPrice.Int64) + } + c.MaxComputeUnitPrice = ptr(uint64(cfg.MaxComputeUnitPrice.Int64)) + } + if cfg.MinComputeUnitPrice.Valid { + if cfg.MinComputeUnitPrice.Int64 < 0 { + return fmt.Errorf("MinComputeUnitPrice is less than zero %d < 0", cfg.MinComputeUnitPrice.Int64) + } + c.MinComputeUnitPrice = ptr(uint64(cfg.MinComputeUnitPrice.Int64)) + } + if cfg.DefaultComputeUnitPrice.Valid { + if cfg.DefaultComputeUnitPrice.Int64 < 0 { + return fmt.Errorf("DefaultComputeUnitPrice is less than zero %d < 0", cfg.DefaultComputeUnitPrice.Int64) + } + c.DefaultComputeUnitPrice = ptr(uint64(cfg.DefaultComputeUnitPrice.Int64)) + } + if cfg.FeeBumpPeriod != nil { + c.FeeBumpPeriod = utils.MustNewDuration(cfg.FeeBumpPeriod.Duration()) + } return nil } @@ -283,6 +393,21 @@ func (c *Chain) SetDefaults() { i := int64(*defaultConfigSet.MaxRetries) c.MaxRetries = &i } + if c.FeeEstimatorMode == nil { + c.FeeEstimatorMode = &defaultConfigSet.FeeEstimatorMode + } + if c.MaxComputeUnitPrice == nil { + c.MaxComputeUnitPrice = &defaultConfigSet.MaxComputeUnitPrice + } + if c.MinComputeUnitPrice == nil { + c.MinComputeUnitPrice = &defaultConfigSet.MinComputeUnitPrice + } + if c.DefaultComputeUnitPrice == nil { + c.DefaultComputeUnitPrice = &defaultConfigSet.DefaultComputeUnitPrice + } + if c.FeeBumpPeriod == nil { + c.FeeBumpPeriod = utils.MustNewDuration(defaultConfigSet.FeeBumpPeriod) + } return } @@ -316,3 +441,7 @@ func (n *Node) ValidateConfig() (err error) { } return } + +func ptr[T any](t T) *T { + return &t +} diff --git a/pkg/solana/config/config_test.go b/pkg/solana/config/config_test.go index 8cbc54c8e..935b0094e 100644 --- a/pkg/solana/config/config_test.go +++ b/pkg/solana/config/config_test.go @@ -17,16 +17,21 @@ import ( // testing configs var ( - testBalancePoll = mustDuration(1 * time.Minute) - testConfirmPeriod = mustDuration(2 * time.Minute) - testCachePeriod = mustDuration(3 * time.Minute) - testTTL = mustDuration(4 * time.Minute) - testTxTimeout = mustDuration(5 * time.Minute) - testTxRetryTimeout = mustDuration(6 * time.Minute) - testTxConfirmTimeout = mustDuration(7 * time.Minute) - testPreflight = false - testCommitment = "finalized" - testMaxRetries int64 = 123 + testBalancePoll = mustDuration(1 * time.Minute) + testConfirmPeriod = mustDuration(2 * time.Minute) + testCachePeriod = mustDuration(3 * time.Minute) + testTTL = mustDuration(4 * time.Minute) + testTxTimeout = mustDuration(5 * time.Minute) + testTxRetryTimeout = mustDuration(6 * time.Minute) + testTxConfirmTimeout = mustDuration(7 * time.Minute) + testPreflight = false + testCommitment = "finalized" + testMaxRetries int64 = 123 + testFeeEstimatorMode = "block" + testMaxComputeUnitPrice uint64 = 100_000 + testMinComputeUnitPrice uint64 = 1 + testDefaultComputeUnitPrice uint64 = 10 + testFeeBumpPeriod = mustDuration(8 * time.Minute) ) func mustDuration(d time.Duration) utils.Duration { @@ -40,32 +45,42 @@ func mustDuration(d time.Duration) utils.Duration { func TestConfig_ExpectedDefaults(t *testing.T) { cfg := NewConfig(db.ChainCfg{}, logger.Test(t)) configSet := configSet{ - BalancePollPeriod: cfg.BalancePollPeriod(), - ConfirmPollPeriod: cfg.ConfirmPollPeriod(), - OCR2CachePollPeriod: cfg.OCR2CachePollPeriod(), - OCR2CacheTTL: cfg.OCR2CacheTTL(), - TxTimeout: cfg.TxTimeout(), - TxRetryTimeout: cfg.TxRetryTimeout(), - TxConfirmTimeout: cfg.TxConfirmTimeout(), - SkipPreflight: cfg.SkipPreflight(), - Commitment: cfg.Commitment(), - MaxRetries: cfg.MaxRetries(), + BalancePollPeriod: cfg.BalancePollPeriod(), + ConfirmPollPeriod: cfg.ConfirmPollPeriod(), + OCR2CachePollPeriod: cfg.OCR2CachePollPeriod(), + OCR2CacheTTL: cfg.OCR2CacheTTL(), + TxTimeout: cfg.TxTimeout(), + TxRetryTimeout: cfg.TxRetryTimeout(), + TxConfirmTimeout: cfg.TxConfirmTimeout(), + SkipPreflight: cfg.SkipPreflight(), + Commitment: cfg.Commitment(), + MaxRetries: cfg.MaxRetries(), + FeeEstimatorMode: cfg.FeeEstimatorMode(), + MaxComputeUnitPrice: cfg.MaxComputeUnitPrice(), + MinComputeUnitPrice: cfg.MinComputeUnitPrice(), + DefaultComputeUnitPrice: cfg.DefaultComputeUnitPrice(), + FeeBumpPeriod: cfg.FeeBumpPeriod(), } assert.Equal(t, defaultConfigSet, configSet) } func TestConfig_NewConfig(t *testing.T) { dbCfg := db.ChainCfg{ - BalancePollPeriod: &testBalancePoll, - ConfirmPollPeriod: &testConfirmPeriod, - OCR2CachePollPeriod: &testCachePeriod, - OCR2CacheTTL: &testTTL, - TxTimeout: &testTxTimeout, - TxRetryTimeout: &testTxRetryTimeout, - TxConfirmTimeout: &testTxConfirmTimeout, - SkipPreflight: null.BoolFrom(testPreflight), - Commitment: null.StringFrom(testCommitment), - MaxRetries: null.IntFrom(testMaxRetries), + BalancePollPeriod: &testBalancePoll, + ConfirmPollPeriod: &testConfirmPeriod, + OCR2CachePollPeriod: &testCachePeriod, + OCR2CacheTTL: &testTTL, + TxTimeout: &testTxTimeout, + TxRetryTimeout: &testTxRetryTimeout, + TxConfirmTimeout: &testTxConfirmTimeout, + SkipPreflight: null.BoolFrom(testPreflight), + Commitment: null.StringFrom(testCommitment), + MaxRetries: null.IntFrom(testMaxRetries), + FeeEstimatorMode: null.StringFrom(testFeeEstimatorMode), + MaxComputeUnitPrice: null.IntFrom(int64(testMaxComputeUnitPrice)), + MinComputeUnitPrice: null.IntFrom(int64(testMinComputeUnitPrice)), + DefaultComputeUnitPrice: null.IntFrom(int64(testDefaultComputeUnitPrice)), + FeeBumpPeriod: &testFeeBumpPeriod, } cfg := NewConfig(dbCfg, logger.Test(t)) assert.Equal(t, testBalancePoll.Duration(), cfg.BalancePollPeriod()) @@ -78,21 +93,31 @@ func TestConfig_NewConfig(t *testing.T) { assert.Equal(t, testPreflight, cfg.SkipPreflight()) assert.Equal(t, rpc.CommitmentType(testCommitment), cfg.Commitment()) assert.EqualValues(t, testMaxRetries, *cfg.MaxRetries()) + assert.Equal(t, testFeeEstimatorMode, cfg.FeeEstimatorMode()) + assert.Equal(t, testMaxComputeUnitPrice, cfg.MaxComputeUnitPrice()) + assert.Equal(t, testMinComputeUnitPrice, cfg.MinComputeUnitPrice()) + assert.Equal(t, testDefaultComputeUnitPrice, cfg.DefaultComputeUnitPrice()) + assert.Equal(t, testFeeBumpPeriod.Duration(), cfg.FeeBumpPeriod()) } func TestConfig_Update(t *testing.T) { cfg := NewConfig(db.ChainCfg{}, logger.Test(t)) dbCfg := db.ChainCfg{ - BalancePollPeriod: &testBalancePoll, - ConfirmPollPeriod: &testConfirmPeriod, - OCR2CachePollPeriod: &testCachePeriod, - OCR2CacheTTL: &testTTL, - TxTimeout: &testTxTimeout, - TxRetryTimeout: &testTxRetryTimeout, - TxConfirmTimeout: &testTxConfirmTimeout, - SkipPreflight: null.BoolFrom(testPreflight), - Commitment: null.StringFrom(testCommitment), - MaxRetries: null.IntFrom(testMaxRetries), + BalancePollPeriod: &testBalancePoll, + ConfirmPollPeriod: &testConfirmPeriod, + OCR2CachePollPeriod: &testCachePeriod, + OCR2CacheTTL: &testTTL, + TxTimeout: &testTxTimeout, + TxRetryTimeout: &testTxRetryTimeout, + TxConfirmTimeout: &testTxConfirmTimeout, + SkipPreflight: null.BoolFrom(testPreflight), + Commitment: null.StringFrom(testCommitment), + MaxRetries: null.IntFrom(testMaxRetries), + FeeEstimatorMode: null.StringFrom(testFeeEstimatorMode), + MaxComputeUnitPrice: null.IntFrom(int64(testMaxComputeUnitPrice)), + MinComputeUnitPrice: null.IntFrom(int64(testMinComputeUnitPrice)), + DefaultComputeUnitPrice: null.IntFrom(int64(testDefaultComputeUnitPrice)), + FeeBumpPeriod: &testFeeBumpPeriod, } cfg.Update(dbCfg) assert.Equal(t, testBalancePoll.Duration(), cfg.BalancePollPeriod()) @@ -105,6 +130,11 @@ func TestConfig_Update(t *testing.T) { assert.Equal(t, testPreflight, cfg.SkipPreflight()) assert.Equal(t, rpc.CommitmentType(testCommitment), cfg.Commitment()) assert.EqualValues(t, testMaxRetries, *cfg.MaxRetries()) + assert.Equal(t, testFeeEstimatorMode, cfg.FeeEstimatorMode()) + assert.Equal(t, testMaxComputeUnitPrice, cfg.MaxComputeUnitPrice()) + assert.Equal(t, testMinComputeUnitPrice, cfg.MinComputeUnitPrice()) + assert.Equal(t, testDefaultComputeUnitPrice, cfg.DefaultComputeUnitPrice()) + assert.Equal(t, testFeeBumpPeriod.Duration(), cfg.FeeBumpPeriod()) } func TestConfig_CommitmentFallback(t *testing.T) { @@ -112,6 +142,17 @@ func TestConfig_CommitmentFallback(t *testing.T) { assert.Equal(t, rpc.CommitmentConfirmed, cfg.Commitment()) } +func TestConfig_ComputeBudgetPriceFallback(t *testing.T) { + cfg := NewConfig(db.ChainCfg{ + MaxComputeUnitPrice: null.IntFrom(-1), + MinComputeUnitPrice: null.IntFrom(-1), + DefaultComputeUnitPrice: null.IntFrom(-1), + }, logger.Test(t)) + assert.Equal(t, defaultConfigSet.MaxComputeUnitPrice, cfg.MaxComputeUnitPrice()) + assert.Equal(t, defaultConfigSet.MinComputeUnitPrice, cfg.MinComputeUnitPrice()) + assert.Equal(t, defaultConfigSet.DefaultComputeUnitPrice, cfg.DefaultComputeUnitPrice()) +} + func TestConfig_MaxRetriesNegativeFallback(t *testing.T) { cfg := NewConfig(db.ChainCfg{MaxRetries: null.IntFrom(-100)}, logger.Test(t)) assert.Nil(t, cfg.MaxRetries()) @@ -126,27 +167,37 @@ func TestChain_SetFromDB(t *testing.T) { {"nil", nil, Chain{}}, {"empty", &db.ChainCfg{}, Chain{}}, {"full", &db.ChainCfg{ - BalancePollPeriod: utils.MustNewDuration(5 * time.Second), - ConfirmPollPeriod: utils.MustNewDuration(500 * time.Millisecond), - OCR2CachePollPeriod: utils.MustNewDuration(time.Second), - OCR2CacheTTL: utils.MustNewDuration(time.Minute), - TxTimeout: utils.MustNewDuration(time.Minute), - TxRetryTimeout: utils.MustNewDuration(10 * time.Second), - TxConfirmTimeout: utils.MustNewDuration(30 * time.Second), - SkipPreflight: null.BoolFrom(true), - Commitment: null.StringFrom("confirmed"), - MaxRetries: null.IntFrom(0), + BalancePollPeriod: utils.MustNewDuration(5 * time.Second), + ConfirmPollPeriod: utils.MustNewDuration(500 * time.Millisecond), + OCR2CachePollPeriod: utils.MustNewDuration(time.Second), + OCR2CacheTTL: utils.MustNewDuration(time.Minute), + TxTimeout: utils.MustNewDuration(time.Minute), + TxRetryTimeout: utils.MustNewDuration(10 * time.Second), + TxConfirmTimeout: utils.MustNewDuration(30 * time.Second), + SkipPreflight: null.BoolFrom(true), + Commitment: null.StringFrom("confirmed"), + MaxRetries: null.IntFrom(0), + FeeEstimatorMode: null.StringFrom("block"), + MaxComputeUnitPrice: null.IntFrom(100), + MinComputeUnitPrice: null.IntFrom(10), + DefaultComputeUnitPrice: null.IntFrom(50), + FeeBumpPeriod: utils.MustNewDuration(3 * time.Second), }, Chain{ - BalancePollPeriod: utils.MustNewDuration(5 * time.Second), - ConfirmPollPeriod: utils.MustNewDuration(500 * time.Millisecond), - OCR2CachePollPeriod: utils.MustNewDuration(time.Second), - OCR2CacheTTL: utils.MustNewDuration(time.Minute), - TxTimeout: utils.MustNewDuration(time.Minute), - TxRetryTimeout: utils.MustNewDuration(10 * time.Second), - TxConfirmTimeout: utils.MustNewDuration(30 * time.Second), - SkipPreflight: ptr(true), - Commitment: ptr("confirmed"), - MaxRetries: ptr[int64](0), + BalancePollPeriod: utils.MustNewDuration(5 * time.Second), + ConfirmPollPeriod: utils.MustNewDuration(500 * time.Millisecond), + OCR2CachePollPeriod: utils.MustNewDuration(time.Second), + OCR2CacheTTL: utils.MustNewDuration(time.Minute), + TxTimeout: utils.MustNewDuration(time.Minute), + TxRetryTimeout: utils.MustNewDuration(10 * time.Second), + TxConfirmTimeout: utils.MustNewDuration(30 * time.Second), + SkipPreflight: ptr(true), + Commitment: ptr("confirmed"), + MaxRetries: ptr[int64](0), + FeeEstimatorMode: ptr("block"), + MaxComputeUnitPrice: ptr[uint64](100), + MinComputeUnitPrice: ptr[uint64](10), + DefaultComputeUnitPrice: ptr[uint64](50), + FeeBumpPeriod: utils.MustNewDuration(3 * time.Second), }}, } { t.Run(tt.name, func(t *testing.T) { @@ -194,7 +245,3 @@ func TestNode_SetFromDB(t *testing.T) { }) } } - -func ptr[T any](t T) *T { - return &t -} diff --git a/pkg/solana/db/db.go b/pkg/solana/db/db.go index 68e28fbed..8714f7946 100644 --- a/pkg/solana/db/db.go +++ b/pkg/solana/db/db.go @@ -45,6 +45,12 @@ type ChainCfg struct { SkipPreflight null.Bool // to enable or disable preflight checks Commitment null.String MaxRetries null.Int + + FeeEstimatorMode null.String + MaxComputeUnitPrice null.Int + MinComputeUnitPrice null.Int + DefaultComputeUnitPrice null.Int + FeeBumpPeriod *utils.Duration } func (c *ChainCfg) Scan(value interface{}) error { diff --git a/pkg/solana/transmitter.go b/pkg/solana/transmitter.go index a72b9e0ef..0a2777b4e 100644 --- a/pkg/solana/transmitter.go +++ b/pkg/solana/transmitter.go @@ -46,12 +46,13 @@ func (c *Transmitter) Transmit( } accounts := []*solana.AccountMeta{ - // state, transmitter, transmissions, store_program, store, store_authority + // state, transmitter, transmissions, store_program, store, store_authority, instructions_sysvar {PublicKey: c.stateID, IsWritable: true, IsSigner: false}, {PublicKey: c.transmissionSigner, IsWritable: false, IsSigner: true}, {PublicKey: c.transmissionsID, IsWritable: true, IsSigner: false}, {PublicKey: c.storeProgramID, IsWritable: false, IsSigner: false}, {PublicKey: storeAuthority, IsWritable: false, IsSigner: false}, + {PublicKey: solana.SysVarInstructionsPubkey, IsWritable: false, IsSigner: false}, } reportContext := utils.RawReportContext(reportCtx) diff --git a/shell.nix b/shell.nix index c425ebba5..ef6d81e2d 100644 --- a/shell.nix +++ b/shell.nix @@ -27,8 +27,8 @@ pkgs.mkShell { nodePackages.typescript nodePackages.typescript-language-server # Keep this nodejs version in sync with the version in .tool-versions please - nodejs-14_x - (yarn.override { nodejs = nodejs-14_x; }) + nodejs-16_x + (yarn.override { nodejs = nodejs-16_x; }) python3 ]; RUST_BACKTRACE = "1";