diff --git a/.github/actions/build-test-image/action.yml b/.github/actions/build-test-image/action.yml index d6da13909..9309361cd 100644 --- a/.github/actions/build-test-image/action.yml +++ b/.github/actions/build-test-image/action.yml @@ -22,6 +22,8 @@ inputs: runs: using: composite steps: + - name: Install Cairo + uses: ./.github/actions/install-cairo - name: Check if image exists id: check-image uses: smartcontractkit/chainlink-github-actions/docker/image-exists@8489879838862929f43f7d7cd1b33903965cf507 # v2.1.6 diff --git a/.github/actions/install-cairo/action.yml b/.github/actions/install-cairo/action.yml index 2757d5e52..9be721285 100644 --- a/.github/actions/install-cairo/action.yml +++ b/.github/actions/install-cairo/action.yml @@ -4,11 +4,11 @@ description: A composite action that installs cairo and scarb binaries inputs: cairo_version: description: Cairo release version - default: "v1.0.0-rc0" + default: "v1.0.0" required: false scarb_version: description: Scarb release version - default: "v0.2.0-alpha.1" + default: "v0.2.1" required: false runs: @@ -20,12 +20,14 @@ runs: run: | wget https://github.com/starkware-libs/cairo/releases/download/${{ inputs.cairo_version }}/release-x86_64-unknown-linux-musl.tar.gz tar -xvzf release-x86_64-unknown-linux-musl.tar.gz - echo "$GITHUB_WORKSPACE/cairo/bin" >> $GITHUB_PATH + mv -vf cairo cairo-build + echo "$GITHUB_WORKSPACE/cairo-build/bin" >> $GITHUB_PATH - name: Setup Scarb for Linux id: install-scarb shell: bash run: | - wget https://github.com/software-mansion/scarb/releases/download/${{ inputs.scarb_version }}/scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-gnu.tar.gz - tar -xvzf scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-gnu.tar.gz - echo "$GITHUB_WORKSPACE/scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-gnu/bin" >> $GITHUB_PATH + wget https://github.com/software-mansion/scarb/releases/download/${{ inputs.scarb_version }}/scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-musl.tar.gz + tar -xvzf scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-musl.tar.gz + mv -vf scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-musl scarb-build + echo "$GITHUB_WORKSPACE/scarb-build/bin" >> $GITHUB_PATH diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 01ab398cd..3800499bf 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -23,6 +23,9 @@ jobs: - name: Install Cairo uses: ./.github/actions/install-cairo + - name: Install starknet-devnet (via venv+pip) + run: nix develop -c pip install -r contracts/requirements.txt -c contracts/constraints.txt + - name: Test run: nix develop -c make test-ts-contracts @@ -32,8 +35,6 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - with: - submodules: 'recursive' - name: Install Nix uses: cachix/install-nix-action@5c11eae19dba042788936d4f1c9685fdd814ac49 # v19 diff --git a/.github/workflows/integration-tests-smoke.yml b/.github/workflows/integration-tests-smoke.yml index 7c4d6e6ce..a6629040f 100644 --- a/.github/workflows/integration-tests-smoke.yml +++ b/.github/workflows/integration-tests-smoke.yml @@ -33,7 +33,7 @@ jobs: - name: Collect Metrics if: always() id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@808c183d1f5c26a4f3fd50b75d3cf7b58d9aa293 + uses: smartcontractkit/push-gha-metrics-action@90fcbaac8ebf86da9c4d55dba24f6fe3029f0e0b with: basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} @@ -41,7 +41,7 @@ jobs: continue-on-error: true - name: Check if image exists id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@8489879838862929f43f7d7cd1b33903965cf507 # v2.1.6 + uses: smartcontractkit/chainlink-github-actions/docker/image-exists@2c9f401149f6c25fb632067b7e6626aebeee5d69 # v2.1.6 with: repository: chainlink tag: starknet.${{ github.sha }} @@ -50,10 +50,10 @@ jobs: - name: Build Image if: steps.check-image.outputs.exists == 'false' # note using a temporary commit for build-image that works around the go get issues, replace when go get issues are fixed please - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@3ec816fe2e6dd3f70511e8115d86e296818c58f8 # cosmos_one_off + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@2c9f401149f6c25fb632067b7e6626aebeee5d69 with: cl_repo: smartcontractkit/chainlink - cl_ref: 6b935c6ff7ec12b16b3f644b64080dec29b5a2c4 + cl_ref: ${{ github.event.inputs.cl_branch_ref }} # commit of the caller branch dep_starknet_sha: ${{ github.event.pull_request.head.sha || github.sha }} push_tag: ${{ env.CL_ECR }}:starknet.${{ github.sha }} @@ -102,7 +102,8 @@ jobs: TEST_ARGS: -test.timeout 1h PRIVATE_KEY: ${{ secrets.GOERLI_PRIVATE_KEY }} ACCOUNT: ${{ secrets.GOERLI_ACCOUNT }} - TTL: 1h + TTL: 3h + TEST_DURATION: 15m NODE_COUNT: 5 permissions: checks: write @@ -113,7 +114,7 @@ jobs: - name: Collect Metrics if: always() id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@808c183d1f5c26a4f3fd50b75d3cf7b58d9aa293 + uses: smartcontractkit/push-gha-metrics-action@8163dcea2f01a0a8fec84b284406ff7af1d2e1c0 with: basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} @@ -126,7 +127,7 @@ jobs: with: nix_path: nixpkgs=channel:nixos-unstable - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@8489879838862929f43f7d7cd1b33903965cf507 # v2.1.6 + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@2c9f401149f6c25fb632067b7e6626aebeee5d69 with: test_command_to_run: nix develop -c make test-integration-smoke-ci test_download_vendor_packages_command: cd integration-tests && nix develop -c go mod download diff --git a/.github/workflows/integration-tests-soak.yml b/.github/workflows/integration-tests-soak.yml index b2a737c04..dc62929ff 100644 --- a/.github/workflows/integration-tests-soak.yml +++ b/.github/workflows/integration-tests-soak.yml @@ -26,8 +26,18 @@ on: required: true default: 72h type: string - - + test_duration: + description: Duration of soak + required: true + default: 72h + type: string + private_key: + description: Private key, ignore for devnet + required: false + type: string + account: + description: Account address, ignore for devnet + required: false # Only run 1 of this workflow at a time per PR concurrency: @@ -48,7 +58,7 @@ jobs: steps: - name: Check if image exists id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@8489879838862929f43f7d7cd1b33903965cf507 # v2.1.6 + uses: smartcontractkit/chainlink-github-actions/docker/image-exists@2c9f401149f6c25fb632067b7e6626aebeee5d69 # v2.1.6 with: repository: chainlink tag: starknet.${{ github.sha }} @@ -56,8 +66,7 @@ jobs: AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - name: Build Image if: steps.check-image.outputs.exists == 'false' - # note using a temporary commit for build-image that works around the go get issues, replace when go get issues are fixed please - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@a2bf54158aa0a77a55f432347bc9ecf8ef642c2b # cosmos_one_off + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@2c9f401149f6c25fb632067b7e6626aebeee5d69 with: cl_repo: smartcontractkit/chainlink # By default we are integrating with CL develop @@ -81,9 +90,10 @@ jobs: env: CHAINLINK_ENV_USER: ${{ github.actor }} L2_RPC_URL: ${{ github.event.inputs.l2_rpc_url }} + TEST_DURATION: ${{ github.event.inputs.test_duration }} NODE_COUNT: ${{ github.event.inputs.node_count }} - PRIVATE_KEY: ${{ secrets.GOERLI_PRIVATE_KEY }} - ACCOUNT: ${{ secrets.GOERLI_ACCOUNT }} + PRIVATE_KEY: ${{ github.event.inputs.private_key }} + ACCOUNT: ${{ github.event.inputs.account }} TTL: ${{ github.event.inputs.ttl }} DETACH_RUNNER: true TEST_SUITE: soak @@ -108,7 +118,7 @@ jobs: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ce87f8986ca18336cc5015df75916c2ec0a7c4b3 # v2.1.2 + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@2c9f401149f6c25fb632067b7e6626aebeee5d69 # v2.1.2 with: test_command_to_run: nix develop -c make test-integration-soak-ci test_download_vendor_packages_command: cd integration-tests && nix develop -c go mod download diff --git a/.github/workflows/integration_contracts.yml b/.github/workflows/integration_contracts.yml index fa421a134..835082dd8 100644 --- a/.github/workflows/integration_contracts.yml +++ b/.github/workflows/integration_contracts.yml @@ -23,5 +23,8 @@ jobs: - name: Install Cairo uses: ./.github/actions/install-cairo + - name: Install starknet-devnet (via venv+pip) + run: nix develop -c pip install -r contracts/requirements.txt -c contracts/constraints.txt + - name: Test run: nix develop -c make test-integration-contracts diff --git a/.golangci.yml b/.golangci.yml index 90153703e..1ba9f83f5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -10,6 +10,7 @@ linters: - misspell # - rowserrcheck - errorlint + - durationcheck linters-settings: exhaustive: default-signifies-exhaustive: true diff --git a/.tool-versions b/.tool-versions index 8d6eb7777..55a3fa158 100644 --- a/.tool-versions +++ b/.tool-versions @@ -5,7 +5,7 @@ golang 1.20.1 python 3.9.13 # Tools -mockery 2.13.0-beta.1 +mockery 2.22.1 golangci-lint 1.51.2 actionlint 1.6.12 shellcheck 0.8.0 diff --git a/Makefile b/Makefile index 0554a5928..624936d10 100644 --- a/Makefile +++ b/Makefile @@ -206,18 +206,18 @@ test-integration-smoke: test-integration-prep .PHONY: test-integration-smoke-ci test-integration-smoke-ci: cd integration-tests/ && \ - go test --timeout=2h -v -count=1 -json ./smoke 2>&1 | tee /tmp/gotest.log | gotestfmt + go test --timeout=2h -v -count=1 -json ./smoke .PHONY: test-integration-soak test-integration-soak: test-integration-prep cd integration-tests/ && \ - go test --timeout=1h -v ./soak + go test --timeout=1h -v -json./soak # CI Already has already ran test-integration-prep .PHONY: test-integration-soak-ci test-integration-soak-ci: cd integration-tests/ && \ - go test --timeout=1h -v -count=1 -json ./soak 2>&1 | tee /tmp/gotest.log | gotestfmt + go test --timeout=1h -v -count=1 -json ./soak .PHONY: test-integration-contracts # TODO: better network lifecycle setup - requires external network (L1 + L2) @@ -257,7 +257,7 @@ test-integration-gauntlet: build-ts env-devnet-hardhat-down test-ts: test-ts-contracts test-integration-contracts test-integration-gauntlet .PHONY: test-ts-contracts -test-ts-contracts: build-sol-contracts build-ts-workspace env-devnet-hardhat +test-ts-contracts: build-ts env-devnet-hardhat cd contracts/ && \ yarn test diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 04f8424fd..4ca4cfd44 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -3,6 +3,7 @@ import '@shardlabs/starknet-hardhat-plugin' import '@nomiclabs/hardhat-ethers' import '@nomicfoundation/hardhat-chai-matchers' import 'solidity-coverage' +import { prepareHardhatArtifacts } from './test/setup' const COMPILER_SETTINGS = { optimizer: { @@ -58,7 +59,9 @@ const config: HardhatUserConfig = { }, mocha: { timeout: 10000000, - file: './test/setup.ts', + rootHooks: { + beforeAll: prepareHardhatArtifacts, + }, }, paths: { sources: './solidity', diff --git a/contracts/requirements.txt b/contracts/requirements.txt index 0283ad091..62885726a 100644 --- a/contracts/requirements.txt +++ b/contracts/requirements.txt @@ -1,4 +1,5 @@ ecdsa fastecdsa sympy -starknet-devnet>=0.5.0 +cairo-lang>=0.11.1.1 +starknet-devnet>=0.5.2 diff --git a/contracts/solidity/emergency/StarknetValidator.sol b/contracts/solidity/emergency/StarknetValidator.sol index 33fe81a7d..cf4191646 100644 --- a/contracts/solidity/emergency/StarknetValidator.sol +++ b/contracts/solidity/emergency/StarknetValidator.sol @@ -41,6 +41,8 @@ contract StarknetValidator is TypeAndVersionInterface, AggregatorValidatorInterf error InvalidL2FeedAddress(); /// @notice Error thrown when the source aggregator address is 0 error InvalidSourceAggregatorAddress(); + /// @notice Error thrown when the access controller address is 0 + error InvalidAccessControllerAddress(); /// @notice Error thrown when the l1 gas price feed address is 0 error InvalidGasPriceL1FeedAddress(); /// @notice Error thrown when caller is not the owner and does not have access @@ -240,6 +242,10 @@ contract StarknetValidator is TypeAndVersionInterface, AggregatorValidatorInterf * @param accessController The address of the Access Controller for this contract */ function _setConfigAC(address accessController) internal { + if (accessController == address(0)) { + revert InvalidAccessControllerAddress(); + } + address previousAccessController = address(s_configAC); if (accessController != previousAccessController) { // NOTICE: we don't give access to the new source aggregator diff --git a/contracts/src/access_control/access_controller.cairo b/contracts/src/access_control/access_controller.cairo index 7aa888ac4..308fec845 100644 --- a/contracts/src/access_control/access_controller.cairo +++ b/contracts/src/access_control/access_controller.cairo @@ -1,3 +1,14 @@ +use starknet::ContractAddress; + +#[abi] +trait IAccessController { + fn has_access(user: ContractAddress, data: Array) -> bool; + fn add_access(user: ContractAddress); + fn remove_access(user: ContractAddress); + fn enable_access_check(); + fn disable_access_check(); +} + #[contract] mod AccessController { use starknet::ContractAddress; diff --git a/contracts/src/emergency/sequencer_uptime_feed.cairo b/contracts/src/emergency/sequencer_uptime_feed.cairo index 6d37f18d8..ec6185299 100644 --- a/contracts/src/emergency/sequencer_uptime_feed.cairo +++ b/contracts/src/emergency/sequencer_uptime_feed.cairo @@ -1,5 +1,10 @@ #[contract] mod SequencerUptimeFeed { + use starknet::EthAddress; + use starknet::EthAddressSerde; + use starknet::EthAddressIntoFelt252; + use starknet::Felt252TryIntoEthAddress; + use starknet::EthAddressZeroable; use starknet::ContractAddress; use starknet::StorageAccess; use starknet::StorageBaseAddress; @@ -13,6 +18,7 @@ mod SequencerUptimeFeed { use traits::Into; use traits::TryInto; use option::OptionTrait; + use zeroable::Zeroable; use chainlink::libraries::ownable::Ownable; use chainlink::libraries::access_control::AccessControl; @@ -22,10 +28,8 @@ mod SequencerUptimeFeed { use chainlink::ocr2::aggregator::Aggregator::TransmissionStorageAccess; use chainlink::libraries::upgradeable::Upgradeable; - const ETH_ADDRESS_BOUND: felt252 = 0x10000000000000000000000000000000000000000; // 2**160 - struct Storage { - // l1 sender is an ethereum address + // l1 sender is an starknet validator ethereum address _l1_sender: felt252, // maps round id to round transmission _round_transmissions: LegacyMap, @@ -47,7 +51,7 @@ mod SequencerUptimeFeed { ) {} #[event] - fn L1SenderTransferred(from_address: felt252, to_address: felt252) {} + fn L1SenderTransferred(from_address: EthAddress, to_address: EthAddress) {} impl Aggregator of IAggregator { fn latest_round_data() -> Round { @@ -118,25 +122,22 @@ mod SequencerUptimeFeed { } #[external] - fn set_l1_sender(address: felt252) { + fn set_l1_sender(address: EthAddress) { Ownable::assert_only_owner(); - // convert both to u256 (felts don't implement PartialOrd) - assert(address.into() < ETH_ADDRESS_BOUND.into(), 'invalid eth address'); - - assert(address != 0, '0 address not allowed'); + assert(!address.is_zero(), '0 address not allowed'); let old_address = _l1_sender::read(); - if old_address != address { - _l1_sender::write(address); - L1SenderTransferred(old_address, address); + if old_address != address.into() { + _l1_sender::write(address.into()); + L1SenderTransferred(old_address.try_into().unwrap(), address); } } #[view] - fn l1_sender() -> felt252 { - _l1_sender::read() + fn l1_sender() -> EthAddress { + _l1_sender::read().try_into().unwrap() } /// @@ -216,11 +217,6 @@ mod SequencerUptimeFeed { AccessControl::has_access(user, data) } - #[view] - fn check_access(user: ContractAddress) { - AccessControl::check_access(user) - } - #[external] fn add_access(user: ContractAddress) { Ownable::assert_only_owner(); diff --git a/contracts/src/libraries/token/erc677.cairo b/contracts/src/libraries/token/erc677.cairo index 6713922d7..e9e1dd080 100644 --- a/contracts/src/libraries/token/erc677.cairo +++ b/contracts/src/libraries/token/erc677.cairo @@ -19,7 +19,8 @@ mod ERC677 { use super::IERC677ReceiverDispatcher; use super::IERC677ReceiverDispatcherTrait; - const IERC677_RECEIVER_ID: u32 = 0xa53f2491_u32; + // ethereum function selector of "onTokenTransfer(address,uint256,bytes)" + const IERC677_RECEIVER_ID: u32 = 0xa4c0ed36_u32; #[event] fn Transfer(from: ContractAddress, to: ContractAddress, value: u256, data: Array) {} diff --git a/contracts/src/multisig.cairo b/contracts/src/multisig.cairo index f9de698a5..c569b75b1 100644 --- a/contracts/src/multisig.cairo +++ b/contracts/src/multisig.cairo @@ -236,11 +236,11 @@ mod Multisig { #[external] fn submit_transaction( - to: ContractAddress, function_selector: felt252, calldata: Array, nonce: u128 + to: ContractAddress, function_selector: felt252, calldata: Array, ) { _require_signer(); - _require_valid_nonce(nonce); + let nonce = _next_nonce::read(); let calldata_len = calldata.len(); let transaction = Transaction { @@ -299,6 +299,7 @@ mod Multisig { #[external] fn execute_transaction(nonce: u128) -> Array { + _require_signer(); _require_tx_exists(nonce); _require_tx_valid(nonce); _require_not_executed(nonce); @@ -339,6 +340,8 @@ mod Multisig { let signers_len = _signers_len::read(); _require_valid_threshold(threshold, signers_len); + _update_tx_valid_since(); + _set_threshold(threshold); } @@ -346,6 +349,8 @@ mod Multisig { fn set_signers(signers: Array) { _require_multisig(); + _update_tx_valid_since(); + let signers_len = signers.len(); _set_signers(signers, signers_len); @@ -364,6 +369,8 @@ mod Multisig { let signers_len = signers.len(); _require_valid_threshold(threshold, signers_len); + _update_tx_valid_since(); + _set_signers(signers, signers_len); _set_threshold(threshold); } @@ -375,9 +382,6 @@ mod Multisig { let old_signers_len = _signers_len::read(); _clean_signers_range(0_usize, old_signers_len); - let tx_valid_since = _next_nonce::read(); - _tx_valid_since::write(tx_valid_since); - _signers_len::write(signers_len); _set_signers_range(0_usize, signers_len, @signers); @@ -455,6 +459,11 @@ mod Multisig { ThresholdSet(threshold); } + fn _update_tx_valid_since() { + let tx_valid_since = _next_nonce::read(); + _tx_valid_since::write(tx_valid_since); + } + fn _require_signer() { let caller = get_caller_address(); let is_signer = _is_signer::read(caller); @@ -508,9 +517,4 @@ mod Multisig { assert(threshold >= 1_usize, 'invalid threshold, too small'); assert(threshold <= signers_len, 'invalid threshold, too large'); } - - fn _require_valid_nonce(nonce: u128) { - let next_nonce = _next_nonce::read(); - assert(nonce == next_nonce, 'invalid nonce'); - } } diff --git a/contracts/src/ocr2/aggregator.cairo b/contracts/src/ocr2/aggregator.cairo index 06eb5fec4..655a078ff 100644 --- a/contracts/src/ocr2/aggregator.cairo +++ b/contracts/src/ocr2/aggregator.cairo @@ -88,9 +88,9 @@ mod Aggregator { use starknet::storage_address_from_base_and_offset; use starknet::class_hash::ClassHash; + use chainlink::utils::split_felt; use chainlink::libraries::ownable::Ownable; use chainlink::libraries::access_control::AccessControl; - use chainlink::utils::split_felt; use chainlink::libraries::upgradeable::Upgradeable; // NOTE: remove duplication once we can directly use the trait @@ -101,6 +101,16 @@ mod Aggregator { // fn transfer_from(sender: ContractAddress, recipient: ContractAddress, amount: u256) -> bool; } + // NOTE: remove duplication once we can directly use the trait + #[abi] + trait IAccessController { + fn has_access(user: ContractAddress, data: Array) -> bool; + fn add_access(user: ContractAddress); + fn remove_access(user: ContractAddress); + fn enable_access_check(); + fn disable_access_check(); + } + const GIGA: u128 = 1000000000_u128; const MAX_ORACLES: u32 = 31_u32; @@ -392,13 +402,6 @@ mod Aggregator { } } - #[derive(Copy, Drop, Serde)] - struct OnchainConfig { - version: u8, - min_answer: u128, - max_answer: u128, - } - #[external] fn set_config( oracles: Array, @@ -417,7 +420,10 @@ mod Aggregator { let min_answer = _min_answer::read(); let max_answer = _max_answer::read(); - let computed_onchain_config = OnchainConfig { version: 1_u8, min_answer, max_answer }; + let mut computed_onchain_config = ArrayTrait::new(); + computed_onchain_config.append(1); // version + computed_onchain_config.append(min_answer.into()); + computed_onchain_config.append(max_answer.into()); pay_oracles(); @@ -463,7 +469,7 @@ mod Aggregator { config_count, oracles, f, - onchain_config, + computed_onchain_config, offchain_config_version, offchain_config ); @@ -531,7 +537,7 @@ mod Aggregator { config_count: u64, oracles: @Array, f: u8, - onchain_config: @OnchainConfig, + onchain_config: @Array, offchain_config_version: u64, offchain_config: @Array, ) -> felt252 { @@ -542,14 +548,20 @@ mod Aggregator { state = LegacyHash::hash(state, oracles.len()); state = LegacyHash::hash(state, oracles.span()); // for oracle in oracles, hash each state = LegacyHash::hash(state, f); - state = LegacyHash::hash(state, 3); // onchain_config.len() = 3 - state = LegacyHash::hash(state, *onchain_config.version); - state = LegacyHash::hash(state, *onchain_config.min_answer); - state = LegacyHash::hash(state, *onchain_config.max_answer); + state = LegacyHash::hash(state, onchain_config.len()); + state = LegacyHash::hash(state, onchain_config.span()); state = LegacyHash::hash(state, offchain_config_version); state = LegacyHash::hash(state, offchain_config.len()); state = LegacyHash::hash(state, offchain_config.span()); - let len: usize = 3 + 1 + oracles.len() + 6 + 1 + offchain_config.len(); + let len: usize = 3 + + 1 + + (oracles.len() * 2) + + 1 + + 1 + + onchain_config.len() + + 1 + + 1 + + offchain_config.len(); state = LegacyHash::hash(state, len); // since there's no bitwise ops on felt252, we split into two u128s and recombine. @@ -766,7 +778,13 @@ mod Aggregator { } #[view] - fn latest_transmission_details() {} + fn latest_transmission_details() -> (felt252, u64, u128, u64) { + let config_digest = _latest_config_digest::read(); + let latest_round_id = _latest_aggregator_round_id::read(); + let epoch_and_round = _latest_epoch_and_round::read(); + let transmission = _transmissions::read(latest_round_id); + (config_digest, epoch_and_round, transmission.answer, transmission.transmission_timestamp) + } // --- RequestNewRound @@ -820,9 +838,10 @@ mod Aggregator { pay_oracles(); - // transfer remaining balance to recipient - let amount = token.balance_of(account: contract_address); - token.transfer(recipient, amount); + // transfer remaining balance of old token to recipient + let old_token_dispatcher = IERC20Dispatcher { contract_address: old_token }; + let amount = old_token_dispatcher.balance_of(account: contract_address); + old_token_dispatcher.transfer(recipient, amount); _link_token::write(link_token); @@ -851,11 +870,6 @@ mod Aggregator { // --- Billing Config - #[abi] - trait IAccessController { - fn check_access(user: ContractAddress); - } - #[derive(Copy, Drop, Serde)] struct Billing { observation_payment_gjuels: u32, @@ -940,7 +954,9 @@ mod Aggregator { let access_controller = _billing_access_controller::read(); let access_controller = IAccessControllerDispatcher { contract_address: access_controller }; - access_controller.check_access(caller); + assert( + access_controller.has_access(caller, ArrayTrait::new()), 'caller does not have access' + ); } // --- Payments and Withdrawals diff --git a/contracts/src/tests.cairo b/contracts/src/tests.cairo index 5ff62f3c6..4d8104499 100644 --- a/contracts/src/tests.cairo +++ b/contracts/src/tests.cairo @@ -9,3 +9,4 @@ mod test_link_token; mod test_upgradeable; mod test_access_controller; mod test_mock_aggregator; +mod test_sequencer_uptime_feed; diff --git a/contracts/src/tests/test_access_controller.cairo b/contracts/src/tests/test_access_controller.cairo index d0d85448a..179ee9d9b 100644 --- a/contracts/src/tests/test_access_controller.cairo +++ b/contracts/src/tests/test_access_controller.cairo @@ -1,7 +1,16 @@ use starknet::ContractAddress; use starknet::testing::set_caller_address; +use starknet::testing::set_contract_address; use starknet::contract_address_const; use starknet::class_hash::class_hash_const; +use starknet::class_hash::Felt252TryIntoClassHash; +use starknet::syscalls::deploy_syscall; + +use array::ArrayTrait; +use traits::Into; +use traits::TryInto; +use option::OptionTrait; +use core::result::ResultTrait; use chainlink::access_control::access_controller::AccessController; @@ -19,3 +28,58 @@ fn test_upgrade_not_owner() { AccessController::upgrade(class_hash_const::<2>()); } + +#[test] +#[available_gas(2000000)] +fn test_access_control() { + let owner = setup(); + // Deploy access controller + let mut calldata = ArrayTrait::new(); + calldata.append(owner.into()); // owner + let (accessControllerAddr, _) = deploy_syscall( + AccessController::TEST_CLASS_HASH.try_into().unwrap(), 0, calldata.span(), false + ).unwrap(); + + should_implement_access_control(accessControllerAddr, owner); +} + +// +// Tests for contracts that inherit AccessControl. +// Write functions are assumed to be protected by Ownable::only_owner, +// but this test does not check for that. +// + +#[abi] +trait IAccessController { + fn has_access(user: ContractAddress, data: Array) -> bool; + fn add_access(user: ContractAddress); + fn remove_access(user: ContractAddress); + fn enable_access_check(); + fn disable_access_check(); +} + +fn should_implement_access_control(contract_addr: ContractAddress, owner: ContractAddress) { + let contract = IAccessControllerDispatcher { contract_address: contract_addr }; + let acc2: ContractAddress = contract_address_const::<2222987765>(); + + set_contract_address(owner); // required to call contract as owner + + // access check is enabled by default + assert(!contract.has_access(acc2, ArrayTrait::new()), 'should not have access'); + + // disable access check + contract.disable_access_check(); + assert(contract.has_access(acc2, ArrayTrait::new()), 'should have access'); + + // enable access check + contract.enable_access_check(); + assert(!contract.has_access(acc2, ArrayTrait::new()), 'should not have access'); + + // add_access for acc2 + contract.add_access(acc2); + assert(contract.has_access(acc2, ArrayTrait::new()), 'should have access'); + + // remove_access for acc2 + contract.remove_access(acc2); + assert(!contract.has_access(acc2, ArrayTrait::new()), 'should not have access'); +} diff --git a/contracts/src/tests/test_aggregator.cairo b/contracts/src/tests/test_aggregator.cairo index cf8552893..afad0832f 100644 --- a/contracts/src/tests/test_aggregator.cairo +++ b/contracts/src/tests/test_aggregator.cairo @@ -1,4 +1,5 @@ use starknet::testing::set_caller_address; +use starknet::testing::set_contract_address; use starknet::ContractAddress; use starknet::contract_address_const; use starknet::class_hash::class_hash_const; @@ -13,7 +14,10 @@ use core::result::ResultTrait; use chainlink::ocr2::aggregator::pow; use chainlink::ocr2::aggregator::Aggregator; +use chainlink::ocr2::aggregator::Aggregator::Billing; +use chainlink::access_control::access_controller::AccessController; use chainlink::tests::test_ownable::should_implement_ownable; +use chainlink::tests::test_access_controller::should_implement_access_control; // TODO: aggregator tests @@ -54,16 +58,39 @@ fn test_pow_2_0() { assert(pow(2, 31) == 0x80000000, 'expected 0x80000000'); } -fn setup() -> ContractAddress { - let account: ContractAddress = contract_address_const::<777>(); - set_caller_address(account); - account +#[abi] +trait IAccessController { // importing from access_controller.cairo doesnt work + fn has_access(user: ContractAddress, data: Array) -> bool; + fn add_access(user: ContractAddress); + fn remove_access(user: ContractAddress); + fn enable_access_check(); + fn disable_access_check(); +} + +fn setup() -> (ContractAddress, ContractAddress, ContractAddress, IAccessControllerDispatcher) { + let acc1: ContractAddress = contract_address_const::<777>(); + let acc2: ContractAddress = contract_address_const::<888>(); + // set acc1 as default caller + set_caller_address(acc1); + + // deploy billing access controller + let mut calldata = ArrayTrait::new(); + calldata.append(acc1.into()); // owner = acc1; + let (billingAccessControllerAddr, _) = deploy_syscall( + AccessController::TEST_CLASS_HASH.try_into().unwrap(), 0, calldata.span(), false + ).unwrap(); + let billingAccessController = IAccessControllerDispatcher { + contract_address: billingAccessControllerAddr + }; + + // return accounts and billing access controller + (acc1, acc2, billingAccessControllerAddr, billingAccessController) } #[test] #[available_gas(2000000)] fn test_ownable() { - let account = setup(); + let (account, _, _, _) = setup(); // Deploy aggregator let mut calldata = ArrayTrait::new(); calldata.append(account.into()); // owner @@ -80,6 +107,26 @@ fn test_ownable() { should_implement_ownable(aggregatorAddr, account); } +#[test] +#[available_gas(2000000)] +fn test_access_control() { + let (account, _, _, _) = setup(); + // Deploy aggregator + let mut calldata = ArrayTrait::new(); + calldata.append(account.into()); // owner + calldata.append(contract_address_const::<777>().into()); // link token + calldata.append(0); // min_answer + calldata.append(100); // max_answer + calldata.append(contract_address_const::<999>().into()); // billing access controller + calldata.append(8); // decimals + calldata.append(123); // description + let (aggregatorAddr, _) = deploy_syscall( + Aggregator::TEST_CLASS_HASH.try_into().unwrap(), 0, calldata.span(), false + ).unwrap(); + + should_implement_access_control(aggregatorAddr, account); +} + #[test] #[available_gas(2000000)] @@ -88,3 +135,96 @@ fn test_upgrade_non_owner() { let sender = setup(); Aggregator::upgrade(class_hash_const::<123>()); } + +// --- Billing tests --- + +#[test] +#[available_gas(2000000)] +#[should_panic(expected: ('Ownable: caller is not owner', ))] +fn test_set_billing_access_controller_not_owner() { + let (owner, acc2, billingAccessControllerAddr, _) = setup(); + // Aggregator initialization + Aggregator::constructor(owner, contract_address_const::<777>(), 0, 100, acc2, 8, 123); + + // set billing access controller should revert if caller is not owner + set_caller_address(acc2); + Aggregator::set_billing_access_controller(billingAccessControllerAddr); +} + +#[test] +#[available_gas(2000000)] +#[should_panic(expected: ('caller does not have access', ))] +fn test_set_billing_config_no_access() { + let (owner, acc2, billingAccessControllerAddr, _) = setup(); + // Aggregator initialization + Aggregator::constructor( + owner, contract_address_const::<777>(), 0, 100, billingAccessControllerAddr, 8, 123 + ); + + // set billing config as acc2 with no access + let config: Billing = Billing { + observation_payment_gjuels: 1, + transmission_payment_gjuels: 5, + gas_base: 1, + gas_per_signature: 1, + }; + set_caller_address(acc2); + Aggregator::set_billing(config); +} + +#[test] +#[available_gas(2000000)] +fn test_set_billing_config_as_owner() { + let (owner, _, billingAccessControllerAddr, _) = setup(); + // Aggregator initialization + Aggregator::constructor( + owner, contract_address_const::<777>(), 0, 100, billingAccessControllerAddr, 8, 123 + ); + + // set billing config as owner + let config: Billing = Billing { + observation_payment_gjuels: 1, + transmission_payment_gjuels: 5, + gas_base: 1, + gas_per_signature: 1, + }; + Aggregator::set_billing(config); + + // check billing config + let billing = Aggregator::billing(); + assert(billing.observation_payment_gjuels == 1, 'should be 1'); + assert(billing.transmission_payment_gjuels == 5, 'should be 5'); + assert(billing.gas_base == 1, 'should be 1'); + assert(billing.gas_per_signature == 1, 'should be 1'); +} + +#[test] +#[available_gas(2000000)] +fn test_set_billing_config_as_acc_with_access() { + let (owner, acc2, billingAccessControllerAddr, billingAccessController) = setup(); + // grant acc2 access on access controller + set_contract_address(owner); + billingAccessController.add_access(acc2); + + // Aggregator initialization + Aggregator::constructor( + owner, contract_address_const::<777>(), 0, 100, billingAccessControllerAddr, 8, 123 + ); + + // set billing config as acc2 with access + let config: Billing = Billing { + observation_payment_gjuels: 1, + transmission_payment_gjuels: 5, + gas_base: 1, + gas_per_signature: 1, + }; + set_caller_address(acc2); + Aggregator::set_billing(config); + + // check billing config + let billing = Aggregator::billing(); + assert(billing.observation_payment_gjuels == 1, 'should be 1'); + assert(billing.transmission_payment_gjuels == 5, 'should be 5'); + assert(billing.gas_base == 1, 'should be 1'); + assert(billing.gas_per_signature == 1, 'should be 1'); +} diff --git a/contracts/src/tests/test_aggregator_proxy.cairo b/contracts/src/tests/test_aggregator_proxy.cairo index a786b9db3..9c2c999c3 100644 --- a/contracts/src/tests/test_aggregator_proxy.cairo +++ b/contracts/src/tests/test_aggregator_proxy.cairo @@ -16,6 +16,7 @@ use chainlink::ocr2::aggregator_proxy::AggregatorProxy; use chainlink::ocr2::aggregator::Round; use chainlink::utils::split_felt; use chainlink::tests::test_ownable::should_implement_ownable; +use chainlink::tests::test_access_controller::should_implement_access_control; #[abi] trait IMockAggregator { @@ -70,6 +71,21 @@ fn test_ownable() { should_implement_ownable(aggregatorProxyAddr, account); } +#[test] +#[available_gas(2000000)] +fn test_access_control() { + let (account, mockAggregatorAddr, _, _, _) = setup(); + // Deploy aggregator proxy + let mut calldata = ArrayTrait::new(); + calldata.append(account.into()); // owner = account + calldata.append(mockAggregatorAddr.into()); + let (aggregatorProxyAddr, _) = deploy_syscall( + AggregatorProxy::TEST_CLASS_HASH.try_into().unwrap(), 0, calldata.span(), false + ).unwrap(); + + should_implement_access_control(aggregatorProxyAddr, account); +} + #[test] #[available_gas(2000000)] #[should_panic(expected: ('Ownable: caller is not owner', ))] diff --git a/contracts/src/tests/test_multisig.cairo b/contracts/src/tests/test_multisig.cairo index 95c9e7183..d99b67f8f 100644 --- a/contracts/src/tests/test_multisig.cairo +++ b/contracts/src/tests/test_multisig.cairo @@ -1,14 +1,31 @@ +use starknet::class_hash_const; use starknet::contract_address_const; +use starknet::syscalls::deploy_syscall; use starknet::testing::set_caller_address; -use starknet::class_hash::class_hash_const; +use starknet::testing::set_contract_address; +use starknet::Felt252TryIntoClassHash; use array::ArrayTrait; +use option::OptionTrait; +use result::ResultTrait; +use traits::TryInto; use chainlink::multisig::assert_unique_values; use chainlink::multisig::Multisig; -// TODO: test execute_confirmation happy path with mocked -// call_contract_syscall +#[contract] +mod MultisigTest { + use array::ArrayTrait; + + #[external] + fn increment(val1: felt252, val2: felt252) -> Array { + let mut ret = ArrayTrait::new(); + ret.append(val1 + 1); + ret.append(val2 + 1); + ret + } +} + // TODO: test set_threshold with recursive call // TODO: test set_signers with recursive call // TODO: test set_signers_and_thershold with recursive call @@ -117,7 +134,7 @@ fn test_submit_transaction() { set_caller_address(signer); let to = contract_address_const::<42>(); let function_selector = 10; - Multisig::submit_transaction(:to, :function_selector, calldata: sample_calldata(), nonce: 0); + Multisig::submit_transaction(:to, :function_selector, calldata: sample_calldata()); let (transaction, calldata) = Multisig::get_transaction(0); assert(transaction.to == to, 'should match target address'); @@ -139,28 +156,7 @@ fn test_submit_transaction_not_signer() { set_caller_address(contract_address_const::<3>()); Multisig::submit_transaction( - to: contract_address_const::<42>(), - function_selector: 10, - calldata: sample_calldata(), - nonce: 0 - ); -} - -#[test] -#[available_gas(2000000)] -#[should_panic] -fn test_submit_transaction_invalid_nonce() { - let signer = contract_address_const::<1>(); - let mut signers = ArrayTrait::new(); - signers.append(signer); - Multisig::constructor(:signers, threshold: 1); - - set_caller_address(signer); - Multisig::submit_transaction( - to: contract_address_const::<42>(), - function_selector: 10, - calldata: sample_calldata(), - nonce: 1 + to: contract_address_const::<42>(), function_selector: 10, calldata: sample_calldata(), ); } @@ -176,10 +172,7 @@ fn test_confirm_transaction() { set_caller_address(signer1); Multisig::submit_transaction( - to: contract_address_const::<42>(), - function_selector: 10, - calldata: sample_calldata(), - nonce: 0 + to: contract_address_const::<42>(), function_selector: 10, calldata: sample_calldata(), ); Multisig::confirm_transaction(nonce: 0); @@ -200,10 +193,7 @@ fn test_confirm_transaction_not_signer() { Multisig::constructor(:signers, threshold: 1); set_caller_address(signer); Multisig::submit_transaction( - to: contract_address_const::<42>(), - function_selector: 10, - calldata: sample_calldata(), - nonce: 0 + to: contract_address_const::<42>(), function_selector: 10, calldata: sample_calldata(), ); set_caller_address(not_signer); @@ -221,10 +211,7 @@ fn test_revoke_confirmation() { Multisig::constructor(:signers, threshold: 2); set_caller_address(signer1); Multisig::submit_transaction( - to: contract_address_const::<42>(), - function_selector: 10, - calldata: sample_calldata(), - nonce: 0 + to: contract_address_const::<42>(), function_selector: 10, calldata: sample_calldata(), ); Multisig::confirm_transaction(nonce: 0); @@ -247,10 +234,7 @@ fn test_revoke_confirmation_not_signer() { Multisig::constructor(:signers, threshold: 2); set_caller_address(signer); Multisig::submit_transaction( - to: contract_address_const::<42>(), - function_selector: 10, - calldata: sample_calldata(), - nonce: 0 + to: contract_address_const::<42>(), function_selector: 10, calldata: sample_calldata(), ); Multisig::confirm_transaction(nonce: 0); @@ -270,10 +254,7 @@ fn test_execute_confirmation_below_threshold() { Multisig::constructor(:signers, threshold: 2); set_caller_address(signer1); Multisig::submit_transaction( - to: contract_address_const::<42>(), - function_selector: 10, - calldata: sample_calldata(), - nonce: 0 + to: contract_address_const::<42>(), function_selector: 10, calldata: sample_calldata(), ); Multisig::confirm_transaction(nonce: 0); Multisig::execute_transaction(nonce: 0); @@ -289,3 +270,143 @@ fn test_upgrade_not_multisig() { Multisig::upgrade(class_hash_const::<1>()) } +#[test] +#[available_gas(80000000)] +fn test_execute() { + let signer1 = contract_address_const::<1>(); + let signer2 = contract_address_const::<2>(); + let mut signers = ArrayTrait::new(); + signers.append(signer1); + signers.append(signer2); + Multisig::constructor(:signers, threshold: 2); + let (test_address, _) = deploy_syscall( + MultisigTest::TEST_CLASS_HASH.try_into().unwrap(), 0, ArrayTrait::new().span(), false + ).unwrap(); + set_caller_address(signer1); + let mut increment_calldata = ArrayTrait::new(); + increment_calldata.append(42); + increment_calldata.append(100); + Multisig::submit_transaction( + to: test_address, + // increment() + function_selector: 0x7a44dde9fea32737a5cf3f9683b3235138654aa2d189f6fe44af37a61dc60d, + calldata: increment_calldata, + ); + Multisig::confirm_transaction(nonce: 0); + set_caller_address(signer2); + Multisig::confirm_transaction(nonce: 0); + + let response = Multisig::execute_transaction(nonce: 0); + assert(response.len() == 3, 'expected response length 3'); + assert(*response.at(0) == 2, 'expected array length 2'); + assert(*response.at(1) == 43, 'expected array value 43'); + assert(*response.at(2) == 101, 'expected array value 101'); +} + +#[test] +#[available_gas(8000000)] +#[should_panic(expected: ('invalid signer', ))] +fn test_execute_not_signer() { + let signer1 = contract_address_const::<1>(); + let signer2 = contract_address_const::<2>(); + let mut signers = ArrayTrait::new(); + signers.append(signer1); + signers.append(signer2); + Multisig::constructor(:signers, threshold: 2); + set_caller_address(signer1); + Multisig::submit_transaction( + to: contract_address_const::<42>(), function_selector: 10, calldata: sample_calldata(), + ); + Multisig::confirm_transaction(nonce: 0); + set_caller_address(signer2); + Multisig::confirm_transaction(nonce: 0); + + set_caller_address(contract_address_const::<3>()); + Multisig::execute_transaction(nonce: 0); +} + +#[test] +#[available_gas(8000000)] +#[should_panic(expected: ('transaction invalid', ))] +fn test_execute_after_set_signers() { + let contract_address = contract_address_const::<100>(); + set_contract_address(contract_address); + let signer1 = contract_address_const::<1>(); + let signer2 = contract_address_const::<2>(); + let signer3 = contract_address_const::<3>(); + let mut signers = ArrayTrait::new(); + signers.append(signer1); + signers.append(signer2); + Multisig::constructor(:signers, threshold: 2); + set_caller_address(signer1); + Multisig::submit_transaction( + to: contract_address_const::<42>(), function_selector: 10, calldata: sample_calldata(), + ); + Multisig::confirm_transaction(nonce: 0); + set_caller_address(signer2); + Multisig::confirm_transaction(nonce: 0); + set_caller_address(contract_address); + let mut new_signers = ArrayTrait::new(); + new_signers.append(signer2); + new_signers.append(signer3); + Multisig::set_signers(new_signers); + + set_caller_address(signer2); + Multisig::execute_transaction(nonce: 0); +} + +#[test] +#[available_gas(8000000)] +#[should_panic(expected: ('transaction invalid', ))] +fn test_execute_after_set_signers_and_threshold() { + let contract_address = contract_address_const::<100>(); + set_contract_address(contract_address); + let signer1 = contract_address_const::<1>(); + let signer2 = contract_address_const::<2>(); + let signer3 = contract_address_const::<3>(); + let mut signers = ArrayTrait::new(); + signers.append(signer1); + signers.append(signer2); + Multisig::constructor(:signers, threshold: 2); + set_caller_address(signer1); + Multisig::submit_transaction( + to: contract_address_const::<42>(), function_selector: 10, calldata: sample_calldata(), + ); + Multisig::confirm_transaction(nonce: 0); + set_caller_address(signer2); + Multisig::confirm_transaction(nonce: 0); + set_caller_address(contract_address); + let mut new_signers = ArrayTrait::new(); + new_signers.append(signer2); + new_signers.append(signer3); + Multisig::set_signers_and_threshold(new_signers, 1); + + set_caller_address(signer2); + Multisig::execute_transaction(nonce: 0); +} + +#[test] +#[available_gas(8000000)] +#[should_panic(expected: ('transaction invalid', ))] +fn test_execute_after_set_threshold() { + let contract_address = contract_address_const::<100>(); + set_contract_address(contract_address); + let signer1 = contract_address_const::<1>(); + let signer2 = contract_address_const::<2>(); + let mut signers = ArrayTrait::new(); + signers.append(signer1); + signers.append(signer2); + Multisig::constructor(:signers, threshold: 2); + set_caller_address(signer1); + Multisig::submit_transaction( + to: contract_address_const::<42>(), function_selector: 10, calldata: sample_calldata(), + ); + Multisig::confirm_transaction(nonce: 0); + set_caller_address(signer2); + Multisig::confirm_transaction(nonce: 0); + set_caller_address(contract_address); + Multisig::set_threshold(1); + + set_caller_address(signer1); + Multisig::execute_transaction(nonce: 0); +} diff --git a/contracts/src/tests/test_ownable.cairo b/contracts/src/tests/test_ownable.cairo index 8a72b48eb..537b14a75 100644 --- a/contracts/src/tests/test_ownable.cairo +++ b/contracts/src/tests/test_ownable.cairo @@ -141,14 +141,10 @@ fn should_implement_ownable(contract_addr: ContractAddress, owner: ContractAddre // check owner is set correctly assert(owner == contract.owner(), 'owner does not match'); - let caller = starknet::get_caller_address(); - assert(!caller.is_zero(), 'test1'); // transfer ownership - check owner unchanged and proposed owner set correctly set_contract_address(owner); // required to call contract as owner let caller = starknet::get_caller_address(); - assert(!caller.is_zero(), 'test2'); - assert(caller == owner, 'test3'); contract.transfer_ownership(acc2); assert(owner == contract.owner(), 'owner should remain unchanged'); assert(acc2 == contract.proposed_owner(), 'acc2 should be proposed owner'); diff --git a/contracts/src/tests/test_sequencer_uptime_feed.cairo b/contracts/src/tests/test_sequencer_uptime_feed.cairo new file mode 100644 index 000000000..c0451eafd --- /dev/null +++ b/contracts/src/tests/test_sequencer_uptime_feed.cairo @@ -0,0 +1,107 @@ +use starknet::ContractAddress; +use starknet::EthAddress; +use starknet::contract_address_const; +use starknet::class_hash::class_hash_const; +use starknet::class_hash::Felt252TryIntoClassHash; +use starknet::syscalls::deploy_syscall; +use starknet::testing::set_caller_address; +use starknet::testing::set_contract_address; + +use array::ArrayTrait; +use traits::Into; +use traits::TryInto; +use option::OptionTrait; +use core::result::ResultTrait; + +use chainlink::emergency::sequencer_uptime_feed::SequencerUptimeFeed; +use chainlink::ocr2::aggregator_proxy::AggregatorProxy; +use chainlink::tests::test_ownable::should_implement_ownable; +use chainlink::tests::test_access_controller::should_implement_access_control; + +// NOTE: move to separate interface file once we can directly use the trait +#[abi] +trait ISequencerUptimeFeed { + fn l1_sender() -> EthAddress; + fn set_l1_sender(address: EthAddress); +} + +fn setup() -> (ContractAddress, ContractAddress, ISequencerUptimeFeedDispatcher) { + let account: ContractAddress = contract_address_const::<777>(); + set_caller_address(account); + + // Deploy seqeuencer uptime feed + let mut calldata = ArrayTrait::new(); + calldata.append(0); // initial status + calldata.append(account.into()); // owner + let (sequencerFeedAddr, _) = deploy_syscall( + SequencerUptimeFeed::TEST_CLASS_HASH.try_into().unwrap(), 0, calldata.span(), false + ).unwrap(); + let sequencerUptimeFeed = ISequencerUptimeFeedDispatcher { + contract_address: sequencerFeedAddr + }; + + (account, sequencerFeedAddr, sequencerUptimeFeed) +} + +#[test] +#[available_gas(2000000)] +fn test_ownable() { + let (account, sequencerFeedAddr, _) = setup(); + should_implement_ownable(sequencerFeedAddr, account); +} + +#[test] +#[available_gas(2000000)] +fn test_access_control() { + let (account, sequencerFeedAddr, _) = setup(); + should_implement_access_control(sequencerFeedAddr, account); +} + +#[test] +#[available_gas(2000000)] +#[should_panic()] +fn test_set_l1_sender_not_owner() { + let (_, _, sequencerUptimeFeed) = setup(); + sequencerUptimeFeed.set_l1_sender(contract_address_const::<789>().into().try_into().unwrap()); +} + +#[test] +#[available_gas(2000000)] +fn test_set_l1_sender() { + let (owner, _, sequencerUptimeFeed) = setup(); + set_contract_address(owner); + sequencerUptimeFeed.set_l1_sender(contract_address_const::<789>().into().try_into().unwrap()); + assert( + sequencerUptimeFeed.l1_sender() == contract_address_const::<789>().into().try_into().unwrap(), + 'l1_sender should be set to 789' + ); +} + +#[test] +#[available_gas(2000000)] +#[should_panic(expected: ('user does not have read access', ))] +fn test_latest_round_data_no_access() { + let (owner, sequencerFeedAddr, _) = setup(); + AggregatorProxy::constructor(owner, sequencerFeedAddr); + AggregatorProxy::latest_round_data(); +} + +#[test] +#[available_gas(2000000)] +#[should_panic(expected: ('user does not have read access', ))] +fn test_aggregator_proxy_response() { + let (owner, sequencerFeedAddr, _) = setup(); + AggregatorProxy::constructor(owner, sequencerFeedAddr); + + // latest round data + let latest_round_data = AggregatorProxy::latest_round_data(); + assert(latest_round_data.answer == 0, 'latest_round_data should be 0'); + + // description + let description = AggregatorProxy::description(); + assert(description == 'L2 Sequencer Uptime Status Feed', 'description does not match'); + + // decimals + let decimals = AggregatorProxy::decimals(); + assert(decimals == 0, 'decimals should be 0'); +} diff --git a/contracts/test/access/behavior/ownable.ts b/contracts/test/access/behavior/ownable.ts deleted file mode 100644 index 93b0c8cba..000000000 --- a/contracts/test/access/behavior/ownable.ts +++ /dev/null @@ -1,114 +0,0 @@ -import { expect } from 'chai' -import { starknet } from 'hardhat' -import { StarknetContract, Account } from 'hardhat/types/runtime' - -export type BeforeFn = () => Promise -export type TestData = { - ownable: StarknetContract - alice: Account - bob: Account -} - -// NOTICE: Leading zeros are trimmed for an encoded felt (number). -// To decode, the raw felt needs to be start padded up to max felt size (252 bits or < 32 bytes). -const hexPadStart = (data: number | bigint, len: number) => { - return `0x${data.toString(16).padStart(len, '0')}` -} - -const ADDRESS_LEN = 32 * 2 // 32 bytes (hex) - -const addresses = (t: TestData) => ({ - bob: t.bob.starknetContract.address, - alice: t.alice.starknetContract.address, -}) - -const expectOwner = async (c: StarknetContract, expected: string) => { - const { response } = await c.call('owner') - - const owner = hexPadStart(response, ADDRESS_LEN) - expect(owner).to.deep.equal(expected) -} - -const expectProposedOwner = async (c: StarknetContract, expected: string) => { - const { response } = await c.call('proposed_owner') - - const proposedOwner = hexPadStart(response, ADDRESS_LEN) - expect(proposedOwner).to.deep.equal(expected) -} - -// idempotent - end with original owner -export const shouldBehaveLikeOwnableContract = (beforeFn: BeforeFn) => { - describe('ownable behavior', function () { - let t: TestData - - before(async () => { - t = await beforeFn() - }) - - // TODO: test 'owner', 'proposed_owner', 'transfer_ownership', 'accept_ownership' in depth - - it(`should have 'owner' set`, async () => { - const { alice } = addresses(t) - - // initial owner is alice - await expectOwner(t.ownable, alice) - }) - - it(`should be able to 'transfer_ownership'`, async () => { - const { alice, bob } = addresses(t) - - await t.alice.invoke(t.ownable, 'transfer_ownership', { - new_owner: bob, - }) - - // owner is still alice - await expectOwner(t.ownable, alice) - await expectProposedOwner(t.ownable, bob) - }) - - it(`should be able to 'accept_ownership'`, async () => { - const { bob } = addresses(t) - - await t.bob.invoke(t.ownable, 'accept_ownership') - - // owner is now bob - await expectOwner(t.ownable, bob) - await expectProposedOwner(t.ownable, hexPadStart(0, ADDRESS_LEN)) // 0x0 - }) - - it(`should be able to 'transfer_ownership' back`, async () => { - const { alice, bob } = addresses(t) - - await t.bob.invoke(t.ownable, 'transfer_ownership', { - new_owner: alice, - }) - - // owner is still bob - await expectOwner(t.ownable, bob) - await expectProposedOwner(t.ownable, alice) - }) - - it(`should be able to 'accept_ownership' again`, async () => { - const { alice } = addresses(t) - - await t.alice.invoke(t.ownable, 'accept_ownership') - - // owner is now alice - await expectOwner(t.ownable, alice) - await expectProposedOwner(t.ownable, hexPadStart(0, ADDRESS_LEN)) // 0x0 - }) - - it(`should fail with account without fees`, async () => { - const accountNoFees = await starknet.OpenZeppelinAccount.createAccount() - - await t.alice.invoke(t.ownable, 'transfer_ownership', { - new_owner: accountNoFees.address, - }) - - try { - await accountNoFees.invoke(t.ownable, 'accept_ownership', { maxFee: 1e18 }) - expect.fail() - } catch (err: any) {} - }) - }) -} diff --git a/contracts/test/emergency/StarknetValidator.test.ts b/contracts/test/emergency/StarknetValidator.test.ts index b9dc5eb67..54385109f 100644 --- a/contracts/test/emergency/StarknetValidator.test.ts +++ b/contracts/test/emergency/StarknetValidator.test.ts @@ -155,6 +155,20 @@ describe('StarknetValidator', () => { ).to.be.revertedWithCustomError(starknetValidator, 'InvalidSourceAggregatorAddress') }) + it('reverts when the Access Controller address is zero', async () => { + await expect( + starknetValidatorFactory.deploy( + mockStarknetMessaging.address, + ethers.constants.AddressZero, + mockGasPriceFeed.address, + mockAggregator.address, + l2Contract.address, + 0, + 0, + ), + ).to.be.revertedWithCustomError(starknetValidator, 'InvalidAccessControllerAddress') + }) + it('reverts when the L1 Gas Price feed address is zero', async () => { await expect( starknetValidatorFactory.deploy( @@ -245,9 +259,10 @@ describe('StarknetValidator', () => { describe('#setConfigAC', () => { describe('when called by non owner', () => { it('reverts', async () => { - await expect( - starknetValidator.connect(alice).setConfigAC(ethers.constants.AddressZero), - ).to.be.revertedWith('Only callable by owner') + const newACAddr = '0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4' + await expect(starknetValidator.connect(alice).setConfigAC(newACAddr)).to.be.revertedWith( + 'Only callable by owner', + ) }) }) @@ -271,6 +286,12 @@ describe('StarknetValidator', () => { expect(receipt.events).is.empty expect(await starknetValidator.getConfigAC()).to.equal(mockAccessController.address) }) + + it('reverts if address is zero', async () => { + await expect( + starknetValidator.connect(deployer).setConfigAC(ethers.constants.AddressZero), + ).to.be.revertedWithCustomError(starknetValidator, 'InvalidAccessControllerAddress') + }) }) }) @@ -367,94 +388,44 @@ describe('StarknetValidator', () => { }) }) - describe('when access controller address is set', () => { - describe('when called by an address with access', () => { - beforeEach(async () => { - await mockAccessController.mock.hasAccess.returns(true) - }) - - it('correctly sets the gas config', async () => { - const newGasEstimate = 25000 - const newFeedAddr = '0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4' - const newGasAdjustment = 110 - await starknetValidator - .connect(eoaValidator) - .setGasConfig(newGasEstimate, newFeedAddr, newGasAdjustment) - const gasConfig = await starknetValidator.getGasConfig() - expect(gasConfig.gasEstimate).to.equal(newGasEstimate) - expect(gasConfig.gasPriceL1Feed).to.hexEqual(newFeedAddr) - expect(gasConfig.gasAdjustment).to.equal(newGasAdjustment) - }) - - it('emits an event', async () => { - const newGasEstimate = 25000 - const newFeedAddr = '0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4' - const newGasAdjustment = 110 - await expect( - starknetValidator - .connect(eoaValidator) - .setGasConfig(newGasEstimate, newFeedAddr, newGasAdjustment), - ) - .to.emit(starknetValidator, 'GasConfigSet') - .withArgs(newGasEstimate, newFeedAddr, newGasAdjustment) - }) - - describe('when l1 gas price feed address is the zero address', () => { - it('reverts', async () => { - await expect( - starknetValidator - .connect(eoaValidator) - .setGasConfig(25000, ethers.constants.AddressZero, 0), - ).to.be.revertedWithCustomError(starknetValidator, 'InvalidGasPriceL1FeedAddress') - }) - }) - }) - }) - - describe('when access controller address is not set', () => { + describe('when called by an address with access', () => { beforeEach(async () => { - await starknetValidator.connect(deployer).setConfigAC(ethers.constants.AddressZero) + await mockAccessController.mock.hasAccess.returns(true) }) - describe('when called by an address without access', () => { - beforeEach(async () => { - await mockAccessController.mock.hasAccess.returns(false) - }) + it('correctly sets the gas config', async () => { + const newGasEstimate = 25000 + const newFeedAddr = '0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4' + const newGasAdjustment = 110 + await starknetValidator + .connect(eoaValidator) + .setGasConfig(newGasEstimate, newFeedAddr, newGasAdjustment) + const gasConfig = await starknetValidator.getGasConfig() + expect(gasConfig.gasEstimate).to.equal(newGasEstimate) + expect(gasConfig.gasPriceL1Feed).to.hexEqual(newFeedAddr) + expect(gasConfig.gasAdjustment).to.equal(newGasAdjustment) + }) - it('correctly sets the gas config', async () => { - const newGasEstimate = 25000 - const newFeedAddr = '0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4' - const newGasAdjustment = 110 - await starknetValidator + it('emits an event', async () => { + const newGasEstimate = 25000 + const newFeedAddr = '0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4' + const newGasAdjustment = 110 + await expect( + starknetValidator .connect(eoaValidator) - .setGasConfig(newGasEstimate, newFeedAddr, newGasAdjustment) - const gasConfig = await starknetValidator.getGasConfig() - expect(gasConfig.gasEstimate).to.equal(newGasEstimate) - expect(gasConfig.gasPriceL1Feed).to.hexEqual(newFeedAddr) - expect(gasConfig.gasAdjustment).to.equal(newGasAdjustment) - }) + .setGasConfig(newGasEstimate, newFeedAddr, newGasAdjustment), + ) + .to.emit(starknetValidator, 'GasConfigSet') + .withArgs(newGasEstimate, newFeedAddr, newGasAdjustment) + }) - it('emits an event', async () => { - const newGasEstimate = 25000 - const newFeedAddr = '0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4' - const newGasAdjustment = 110 + describe('when l1 gas price feed address is the zero address', () => { + it('reverts', async () => { await expect( starknetValidator .connect(eoaValidator) - .setGasConfig(newGasEstimate, newFeedAddr, newGasAdjustment), - ) - .to.emit(starknetValidator, 'GasConfigSet') - .withArgs(newGasEstimate, newFeedAddr, newGasAdjustment) - }) - - describe('when l1 gas price feed address is the zero address', () => { - it('reverts', async () => { - await expect( - starknetValidator - .connect(eoaValidator) - .setGasConfig(25000, ethers.constants.AddressZero, 0), - ).to.be.revertedWithCustomError(starknetValidator, 'InvalidGasPriceL1FeedAddress') - }) + .setGasConfig(25000, ethers.constants.AddressZero, 0), + ).to.be.revertedWithCustomError(starknetValidator, 'InvalidGasPriceL1FeedAddress') }) }) }) @@ -546,7 +517,7 @@ describe('StarknetValidator', () => { // Assert L2 effects const res = await l2Contract.call('latest_round_data') - expect(res.round.answer).to.equal(1n) + expect(res.response.answer).to.equal(1n) }) it('should always send a **boolean** message to L2 contract', async () => { diff --git a/contracts/test/emergency/sequencer_uptime_feed.test.ts b/contracts/test/emergency/sequencer_uptime_feed.test.ts deleted file mode 100644 index 9cf8434b6..000000000 --- a/contracts/test/emergency/sequencer_uptime_feed.test.ts +++ /dev/null @@ -1,173 +0,0 @@ -import { expect } from 'chai' -import { starknet } from 'hardhat' -import { StarknetContract, Account, StarknetContractFactory } from 'hardhat/types/runtime' -import { num } from 'starknet' -import { shouldBehaveLikeOwnableContract } from '../access/behavior/ownable' -import { account, expectInvokeError, expectSuccessOrDeclared } from '@chainlink/starknet' - -describe('SequencerUptimeFeed', function () { - this.timeout(1_000_000) - - let owner: Account - let nonOwner: Account - const opts = account.makeFunderOptsFromEnv() - const funder = new account.Funder(opts) - let feedFactory: StarknetContractFactory - let proxyFactory: StarknetContractFactory - - // should be beforeeach, but that'd be horribly slow. Just remember that the tests are not idempotent - before(async function () { - owner = await starknet.OpenZeppelinAccount.createAccount() - nonOwner = await starknet.OpenZeppelinAccount.createAccount() - - await funder.fund([ - { account: owner.address, amount: 1e21 }, - { account: nonOwner.address, amount: 1e21 }, - ]) - await owner.deployAccount() - await nonOwner.deployAccount() - - feedFactory = await starknet.getContractFactory('sequencer_uptime_feed') - await expectSuccessOrDeclared(owner.declare(feedFactory, { maxFee: 1e20 })) - proxyFactory = await starknet.getContractFactory('aggregator_proxy') - await expectSuccessOrDeclared(owner.declare(proxyFactory, { maxFee: 1e20 })) - }) - - shouldBehaveLikeOwnableContract(async () => { - const alice = owner - const bob = await starknet.OpenZeppelinAccount.createAccount() - - await funder.fund([{ account: bob.address, amount: 1e21 }]) - - await bob.deployAccount() - - const feed = await alice.deploy( - feedFactory, - { - initial_status: 0, - owner_address: num.toBigInt(alice.starknetContract.address), - }, - { maxFee: 1e20 }, - ) - - return { ownable: feed, alice, bob } - }) - - describe('Test access control via inherited `SimpleReadAccessController`', function () { - const user = 101 - let uptimeFeedContract: StarknetContract - - before(async function () { - uptimeFeedContract = await owner.deploy(feedFactory, { - initial_status: 0, - owner_address: num.toBigInt(owner.starknetContract.address), - }) - }) - - it('should block non-owners from making admin changes', async function () { - await owner.invoke(uptimeFeedContract, 'add_access', { user }) - - await expectInvokeError( - nonOwner.invoke(uptimeFeedContract, 'add_access', { user }), - 'Ownable: caller is not owner', - ) - }) - - it('should report access information correctly', async function () { - { - const res = await uptimeFeedContract.call('has_access', { user: user, data: [] }) - expect(res.response).to.equal(true) - } - - { - const res = await uptimeFeedContract.call('has_access', { user: user + 1, data: [] }) - expect(res.response).to.equal(false) - } - }) - - it('should error on `check_access` without access', async function () { - await uptimeFeedContract.call('check_access', { user: user }) - - await expectInvokeError( - owner.invoke(uptimeFeedContract, 'check_access', { user: user + 1 }), - 'user does not have access', - ) - }) - - it('should disable access check', async function () { - await owner.invoke(uptimeFeedContract, 'disable_access_check', {}) - - const res = await uptimeFeedContract.call('has_access', { user: user + 1, data: [] }) - expect(res.response).to.equal(true) - }) - - it('should enable access check', async function () { - await owner.invoke(uptimeFeedContract, 'enable_access_check', {}) - - const res = await uptimeFeedContract.call('has_access', { user: user + 1, data: [] }) - expect(res.response).to.equal(false) - }) - - it('should remove user access', async function () { - const res = await uptimeFeedContract.call('has_access', { user: user, data: [] }) - expect(res.response).to.equal(true) - - await owner.invoke(uptimeFeedContract, 'remove_access', { user: user }) - - const new_res = await uptimeFeedContract.call('has_access', { user: user, data: [] }) - expect(new_res.response).to.equal(false) - }) - }) - - describe('Test IAggregator interface using a Proxy', function () { - let uptimeFeedContract: StarknetContract - let proxyContract: StarknetContract - - before(async function () { - uptimeFeedContract = await owner.deploy(feedFactory, { - initial_status: 0, - owner_address: num.toBigInt(owner.starknetContract.address), - }) - - proxyContract = await owner.deploy(proxyFactory, { - owner: num.toBigInt(owner.starknetContract.address), - address: num.toBigInt(uptimeFeedContract.address), - }) - - // proxy contract needs to have access to uptimeFeedContract - await owner.invoke(uptimeFeedContract, 'add_access', { user: proxyContract.address }) - }) - - it('should block access when using an account without access', async function () { - const accWithoutAccess = await starknet.OpenZeppelinAccount.createAccount() - - await funder.fund([{ account: accWithoutAccess.address, amount: 1e21 }]) - await accWithoutAccess.deployAccount() - await expectInvokeError( - accWithoutAccess.invoke(proxyContract, 'latest_round_data'), - 'user does not have read access', - ) - }) - - it('should respond via an aggregator_proxy contract', async function () { - { - const res = await proxyContract.call('latest_round_data') - expect(res.response.answer).to.equal(0n) - } - - { - const res = await proxyContract.call('description') - expect(res.response).to.equal( - 134626335741441605527772921271890603575702899782138692259993464692975953252n, - ) - } - - { - const res = await proxyContract.call('decimals') - expect(res.response).to.equal(0n) - } - - // TODO: enable access check and assert correct behaviour - }) - }) -}) diff --git a/contracts/test/ocr2/aggregator.test.ts b/contracts/test/ocr2/aggregator.test.ts index 030c8f44c..31b8b865d 100644 --- a/contracts/test/ocr2/aggregator.test.ts +++ b/contracts/test/ocr2/aggregator.test.ts @@ -2,7 +2,6 @@ import { assert, expect } from 'chai' import { starknet } from 'hardhat' import { ec, hash, num } from 'starknet' import { Account, StarknetContract, StarknetContractFactory } from 'hardhat/types/runtime' -import { shouldBehaveLikeOwnableContract } from '../access/behavior/ownable' import { TIMEOUT } from '../constants' import { account, expectInvokeError, expectSuccessOrDeclared } from '@chainlink/starknet' import { bytesToFelts } from '@chainlink/starknet-gauntlet' @@ -136,16 +135,6 @@ describe('Aggregator', function () { assert.equal(e.name, 'ConfigSet') }) - shouldBehaveLikeOwnableContract(async () => { - const alice = owner - const bob = await starknet.OpenZeppelinAccount.createAccount() - - await funder.fund([{ account: bob.address, amount: 1e21 }]) - await bob.deployAccount() - - return { ownable: aggregator, alice, bob } - }) - describe('OCR aggregator behavior', function () { let transmit = async (epoch_and_round: number, answer: num.BigNumberish): Promise => { let extra_hash = 1 diff --git a/contracts/test/ocr2/aggregator_proxy.test.ts b/contracts/test/ocr2/aggregator_proxy.test.ts index 1755999ed..e8421c0b8 100644 --- a/contracts/test/ocr2/aggregator_proxy.test.ts +++ b/contracts/test/ocr2/aggregator_proxy.test.ts @@ -3,7 +3,6 @@ import { starknet } from 'hardhat' import { num } from 'starknet' import { Account, StarknetContract, StarknetContractFactory } from 'hardhat/types/runtime' import { TIMEOUT } from '../constants' -import { shouldBehaveLikeOwnableContract } from '../access/behavior/ownable' import { account, expectSuccessOrDeclared } from '@chainlink/starknet' describe('AggregatorProxy', function () { @@ -38,15 +37,6 @@ describe('AggregatorProxy', function () { console.log(proxy.address) }) - shouldBehaveLikeOwnableContract(async () => { - const alice = owner - const bob = await starknet.OpenZeppelinAccount.createAccount() - - await funder.fund([{ account: bob.address, amount: 1e21 }]) - await bob.deployAccount() - return { ownable: proxy, alice, bob } - }) - describe('proxy behaviour', function () { it('works', async () => { // insert round into the mock diff --git a/contracts/test/setup.ts b/contracts/test/setup.ts index 8ee808ea8..8c9c516ef 100644 --- a/contracts/test/setup.ts +++ b/contracts/test/setup.ts @@ -1,6 +1,5 @@ import * as fs from 'fs' import * as path from 'path' -import hre from 'hardhat' function findCommonPrefix(path1: string, path2: string): string { const segments1 = path1.split(path.sep) @@ -43,49 +42,53 @@ function findCairoFiles(dir: string): string[] { return filePaths } -const src = hre.config.paths.starknetSources -const target = hre.config.paths.starknetArtifacts -if (!src || !target) { - throw new Error('Missing starknet path config') -} +export function prepareHardhatArtifacts() { + const hre = require('hardhat') + + const src = hre.config.paths.starknetSources + const target = hre.config.paths.starknetArtifacts + if (!src || !target) { + throw new Error('Missing starknet path config') + } -const root = findCommonPrefix(src, target) + const root = findCommonPrefix(src, target) -console.log('Cleaning and regenerating hardhat file structure..') -const generatedPath = path.join(target, src.slice(root.length)) -if (fs.existsSync(generatedPath)) { - fs.rmSync(generatedPath, { recursive: true }) -} + console.log('Cleaning and regenerating hardhat file structure..') + const generatedPath = path.join(target, src.slice(root.length)) + if (fs.existsSync(generatedPath)) { + fs.rmSync(generatedPath, { recursive: true }) + } -const cairoFiles = findCairoFiles(src) -for (const cairoFile of cairoFiles) { - const relativePath = cairoFile - const filename = path.basename(relativePath, '.cairo') + const cairoFiles = findCairoFiles(src) + for (const cairoFile of cairoFiles) { + const relativePath = cairoFile + const filename = path.basename(relativePath, '.cairo') - const camelCaseFilename = toCamelCase(filename) + const camelCaseFilename = toCamelCase(filename) - const sierraFile = `${target}/chainlink_${camelCaseFilename}.sierra.json` - const casmFile = `${target}/chainlink_${camelCaseFilename}.casm.json` + const sierraFile = `${target}/chainlink_${camelCaseFilename}.sierra.json` + const casmFile = `${target}/chainlink_${camelCaseFilename}.casm.json` - if (!fs.existsSync(sierraFile) || !fs.existsSync(casmFile)) { - continue - } + if (!fs.existsSync(sierraFile) || !fs.existsSync(casmFile)) { + continue + } - const subdir = path.dirname(relativePath).slice(root.length) - // Create the corresponding directory - const targetSubdir = path.join(target, subdir, `${filename}.cairo`) - fs.mkdirSync(targetSubdir, { recursive: true }) - - // Copy the sierra and casm files. We need to copy instead of symlink - // because hardhat-starknet-plugin does fs.lstatSync to check if the file - // exists. - fs.copyFileSync(sierraFile, `${targetSubdir}/${filename}.json`) - fs.copyFileSync(casmFile, `${targetSubdir}/${filename}.casm`) - - // Parse and save the ABI JSON - const sierraContent = JSON.parse(fs.readFileSync(sierraFile, 'utf8')) - fs.writeFileSync( - `${targetSubdir}/${filename}_abi.json`, - JSON.stringify(sierraContent.abi, null, 2), - ) + const subdir = path.dirname(relativePath).slice(root.length) + // Create the corresponding directory + const targetSubdir = path.join(target, subdir, `${filename}.cairo`) + fs.mkdirSync(targetSubdir, { recursive: true }) + + // Copy the sierra and casm files. We need to copy instead of symlink + // because hardhat-starknet-plugin does fs.lstatSync to check if the file + // exists. + fs.copyFileSync(sierraFile, `${targetSubdir}/${filename}.json`) + fs.copyFileSync(casmFile, `${targetSubdir}/${filename}.casm`) + + // Parse and save the ABI JSON + const sierraContent = JSON.parse(fs.readFileSync(sierraFile, 'utf8')) + fs.writeFileSync( + `${targetSubdir}/${filename}_abi.json`, + JSON.stringify(sierraContent.abi, null, 2), + ) + } } diff --git a/docs/integration-tests/on-demand-soak.md b/docs/integration-tests/on-demand-soak.md new file mode 100644 index 000000000..1c91d30e3 --- /dev/null +++ b/docs/integration-tests/on-demand-soak.md @@ -0,0 +1,22 @@ +## On demand soak test + + +Soak tests can be triggered in GHA remotely with custom duration on devnet / testnet + +1. Navigate to Actions +2. Select Integration Tests - Soak +3. Click run workflow +4. Enter RPC url (Optional this is for testing on testnet) +5. Specify node count (default is 4+1) +6. Specify TTL of the namespace (This is when to destroy the env) +7. Specify duration of the soak (Should be lower than TTL) +8. Enter private key L2 (Optional, only for testnet) +9. Enter account address L2 (Optional, only for testnet) + + +## Monitoring +Tests will print out a namespace in the "TestOCRSoak" phase in the Run tests step (e.g chainlink-ocr-starknet-472d5) + +1. Enter the namespace in grafana chainlink testing insights dashboard and the logs will be visible + +The remote runner contains the test run and outputs. \ No newline at end of file diff --git a/integration-tests/.sample.env b/integration-tests/.sample.env new file mode 100644 index 000000000..6e1d3b074 --- /dev/null +++ b/integration-tests/.sample.env @@ -0,0 +1,24 @@ + +# Starknet settings +export ACCOUNT= +export PRIVATE_KEY= +export NODE_COUNT=5 +export TTL=1h +export L2_RPC_URL= # https://alpha4.starknet.io + +# Test Settings +export KEEP_ENVIRONMENTS="Never" # Always | OnFail | Never +export CHAINLINK_IMAGE="public.ecr.aws/chainlink/chainlink" # Image repo to pull the Chainlink image from +export CHAINLINK_VERSION="1.13.0" # Version of the Chainlink image to pull +export CHAINLINK_ENV_USER="Satoshi-Nakamoto" # Name of the person running the tests (change to your own) +export TEST_LOG_LEVEL="info" # info | debug | trace + +# Soak/Chaos/Load Test Specific Settings +export ENV_JOB_IMAGE="image-location/chainlink-tests:test-tag" # Image repo to pull the remote-test-runner image from. Check the Integration Tests workflow. +export DETACH_RUNNER="true" # true 99% of the time, false if you are debugging soak test issues +export TEST_SUITE="soak" # soak | chaos | load + +# Slack Notification Settings +export SLACK_API_KEY="xoxb-example-key" # API key used to report soak test results to slack +export SLACK_CHANNEL="C000000000" # Channel ID for the slack bot to post test results +export SLACK_USER="U000000000" # User ID of the person running the soak tests to properly notify them \ No newline at end of file diff --git a/integration-tests/common/common.go b/integration-tests/common/common.go index d7463642f..f460c5a7a 100644 --- a/integration-tests/common/common.go +++ b/integration-tests/common/common.go @@ -8,10 +8,10 @@ import ( "testing" "time" - "github.com/smartcontractkit/caigo/gateway" "github.com/lib/pq" "github.com/rs/zerolog/log" uuid "github.com/satori/go.uuid" + "github.com/smartcontractkit/caigo/gateway" "gopkg.in/guregu/null.v4" "github.com/smartcontractkit/chainlink-env/environment" @@ -42,6 +42,7 @@ type Common struct { ChainId string NodeCount int TTL time.Duration + TestDuration time.Duration Testnet bool L2RPCUrl string PrivateKey string @@ -76,17 +77,30 @@ func New() *Common { if ttlValue != "" { duration, err := time.ParseDuration(ttlValue) if err != nil { - panic(fmt.Sprintf("Please define a proper duration for the test: %v", err)) + panic(fmt.Sprintf("Please define a proper duration for the namespace: %v", err)) } c.TTL, err = time.ParseDuration(*alias.ShortDur(duration)) if err != nil { - panic(fmt.Sprintf("Please define a proper duration for the test: %v", err)) + panic(fmt.Sprintf("Please define a proper duration for the namespace: %v", err)) } } else { panic("Please define TTL of env") } // Setting optional parameters + testDurationValue := getEnv("TEST_DURATION") + if testDurationValue != "" { + duration, err := time.ParseDuration(ttlValue) + if err != nil { + panic(fmt.Sprintf("Please define a proper duration for the test: %v", err)) + } + c.TestDuration, err = time.ParseDuration(*alias.ShortDur(duration)) + if err != nil { + panic(fmt.Sprintf("Please define a proper duration for the test: %v", err)) + } + } else { + c.TestDuration = time.Duration(time.Minute * 15) + } c.L2RPCUrl = getEnv("L2_RPC_URL") // Fetch L2 RPC url if defined c.Testnet = c.L2RPCUrl != "" c.PrivateKey = getEnv("PRIVATE_KEY") @@ -247,6 +261,9 @@ ListenAddresses = ['0.0.0.0:6690'] c.ClConfig = map[string]interface{}{ "replicas": c.NodeCount, "toml": baseTOML, + "db": map[string]any{ + "stateful": true, + }, } c.Env = environment.New(c.K8Config). AddHelm(devnet.New(nil)). diff --git a/integration-tests/common/test_common.go b/integration-tests/common/test_common.go index 7938f33de..fc1f3c2df 100644 --- a/integration-tests/common/test_common.go +++ b/integration-tests/common/test_common.go @@ -10,6 +10,7 @@ import ( "testing" "time" + caigo "github.com/smartcontractkit/caigo" caigotypes "github.com/smartcontractkit/caigo/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -17,11 +18,11 @@ import ( "github.com/smartcontractkit/chainlink-relay/pkg/logger" "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/ocr2" "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" "github.com/smartcontractkit/chainlink-starknet/ops" "github.com/smartcontractkit/chainlink-starknet/ops/devnet" "github.com/smartcontractkit/chainlink-starknet/ops/gauntlet" - "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/keys" ctfClient "github.com/smartcontractkit/chainlink-testing-framework/client" "github.com/smartcontractkit/chainlink/integration-tests/client" @@ -44,7 +45,32 @@ func init() { if err != nil { panic(err) } - defaultWalletAddress = "0x" + hex.EncodeToString(keys.PubKeyToAccount(keys.Raw(keyBytes).Key().PublicKey(), ops.DevnetClassHash, ops.DevnetSalt)) + accountBytes, err := pubKeyToDevnetAccount(starkkey.Raw(keyBytes).Key().PublicKey()) + if err != nil { + panic(err) + } + defaultWalletAddress = "0x" + hex.EncodeToString(accountBytes) +} + +func pubKeyToDevnetAccount(pubkey starkkey.PublicKey) ([]byte, error) { + xHash, err := caigo.Curve.ComputeHashOnElements([]*big.Int{pubkey.X}) + if err != nil { + return nil, err + } + elements := []*big.Int{ + new(big.Int).SetBytes([]byte("STARKNET_CONTRACT_ADDRESS")), + big.NewInt(0), + ops.DevnetSalt, + ops.DevnetClassHash, + xHash, + } + hash, err := caigo.Curve.ComputeHashOnElements(elements) + if err != nil { + return nil, err + } + + // pad big.Int to 32 bytes if needed + return starknet.PadBytes(hash.Bytes(), 32), nil } type Test struct { @@ -247,7 +273,7 @@ func (testState *Test) ValidateRounds(rounds int, isSoak bool) error { // validate balance in aggregator resLINK, errLINK := testState.Starknet.CallContract(ctx, starknet.CallOps{ ContractAddress: caigotypes.HexToHash(testState.LinkTokenAddr), - Selector: "balanceOf", + Selector: "balance_of", Calldata: []string{caigotypes.HexToBN(testState.OCRAddr).String()}, }) require.NoError(testState.T, errLINK, "Reader balance from LINK contract should not fail") @@ -257,12 +283,17 @@ func (testState *Test) ValidateRounds(rounds int, isSoak bool) error { }) require.NoError(testState.T, errAgg, "Reader balance from LINK contract should not fail") balLINK, _ := new(big.Int).SetString(resLINK[0], 0) - balAgg, _ := new(big.Int).SetString(resAgg[0], 0) + balAgg, _ := new(big.Int).SetString(resAgg[1], 0) + isNegative, _ := new(big.Int).SetString(resAgg[0], 0) + if isNegative.Sign() > 0 { + balAgg = new(big.Int).Neg(balAgg) + } + assert.Equal(testState.T, balLINK.Cmp(big.NewInt(0)), 1, "Aggregator should have non-zero balance") assert.GreaterOrEqual(testState.T, balLINK.Cmp(balAgg), 0, "Aggregator payment balance should be <= actual LINK balance") - for start := time.Now(); time.Since(start) < testState.Common.TTL; { - l.Info().Msg(fmt.Sprintf("Elapsed time: %s, Round wait: %s ", time.Since(start), testState.Common.TTL)) + for start := time.Now(); time.Since(start) < testState.Common.TestDuration; { + l.Info().Msg(fmt.Sprintf("Elapsed time: %s, Round wait: %s ", time.Since(start), testState.Common.TestDuration)) res, err := testState.OCR2Client.LatestTransmissionDetails(ctx, caigotypes.HexToHash(testState.OCRAddr)) require.NoError(testState.T, err, "Failed to get latest transmission details") // end condition: enough rounds have occurred diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 93825bf49..a6f6dff19 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -5,44 +5,47 @@ go 1.20 require ( github.com/rs/zerolog v1.29.1 github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b - github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3 + github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e github.com/smartcontractkit/chainlink-env v0.3.29 + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 github.com/smartcontractkit/chainlink-starknet/ops v0.0.0-20230329050701-40e3b18bb026 - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230508053614-9f2fd5fd4ff1 + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230530233948-90c8af98011e github.com/smartcontractkit/chainlink-testing-framework v1.11.5 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20230420131147-ce3c53a39d07 - github.com/smartcontractkit/chainlink/v2 v2.1.0-beta0.0.20230427051455-edb338fd2536 + github.com/smartcontractkit/chainlink/v2 v2.2.0-mercury-20230527.0.20230531010141-105ba3488387 ) require ( - contrib.go.opencensus.io/exporter/stackdriver v0.13.4 // indirect + contrib.go.opencensus.io/exporter/stackdriver v0.13.5 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect + github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac // indirect github.com/VictoriaMetrics/fastcache v1.10.0 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect - github.com/armon/go-metrics v0.4.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect github.com/avast/retry-go v3.0.0+incompatible // indirect github.com/aws/constructs-go/constructs/v10 v10.1.255 // indirect github.com/aws/jsii-runtime-go v1.75.0 // indirect github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect - github.com/benbjohnson/clock v1.3.0 // indirect + github.com/benbjohnson/clock v1.3.4 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/blendle/zapdriver v1.3.1 // indirect github.com/btcsuite/btcd v0.23.4 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bytedance/sonic v1.8.6 // indirect github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2 v2.7.5 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chai2010/gettext-go v1.0.2 // indirect github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/cockroachdb/errors v1.9.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect @@ -66,9 +69,8 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/edsrzf/mmap-go v1.1.0 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect - github.com/ethereum/go-ethereum v1.11.5 // indirect + github.com/ethereum/go-ethereum v1.12.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect @@ -85,36 +87,36 @@ require ( github.com/getsentry/sentry-go v0.19.0 // indirect github.com/gin-contrib/sessions v0.0.5 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/gin-gonic/gin v1.8.2 // indirect + github.com/gin-gonic/gin v1.9.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.11.1 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.12.0 // indirect github.com/go-resty/resty/v2 v2.7.0 // indirect github.com/go-stack/stack v1.8.1 // indirect - github.com/goccy/go-json v0.9.11 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.3 // indirect github.com/golang/glog v1.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect + github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect github.com/google/gnostic v0.6.9 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/gopacket v1.1.19 // indirect - github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect + github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/context v1.1.1 // indirect @@ -127,15 +129,18 @@ require ( github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-hclog v1.4.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/go-plugin v1.4.9 // indirect + github.com/hashicorp/golang-lru v0.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce // indirect github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect - github.com/holiman/uint256 v1.2.0 // indirect + github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect github.com/huin/goupnp v1.0.3 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/ipfs/go-cid v0.0.7 // indirect github.com/ipfs/go-datastore v0.4.5 // indirect @@ -161,12 +166,13 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/kelseyhightower/envconfig v1.4.0 // indirect github.com/klauspost/compress v1.16.3 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/koron/go-ssdp v0.0.2 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a // indirect - github.com/leodido/go-urn v1.2.1 // indirect - github.com/lib/pq v1.10.8 + github.com/leodido/go-urn v1.2.2 // indirect + github.com/lib/pq v1.10.9 github.com/libp2p/go-addr-util v0.0.2 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect @@ -210,12 +216,13 @@ require ( github.com/magiconair/properties v1.8.6 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect - github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect github.com/minio/sha256-simd v0.1.1 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -238,22 +245,23 @@ require ( github.com/multiformats/go-multistream v0.2.2 // indirect github.com/multiformats/go-varint v0.0.6 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.15.0 // indirect + github.com/prometheus/client_golang v1.15.1 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect - github.com/pyroscope-io/client v0.7.0 // indirect + github.com/pyroscope-io/client v0.7.1 // indirect github.com/pyroscope-io/godeltaprof v0.1.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/russross/blackfriday v1.6.0 // indirect @@ -264,23 +272,21 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/slack-go/slack v0.12.2 // indirect - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230424181359-6cb4dc745ec7 - github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc // indirect - github.com/smartcontractkit/ocr2keepers v0.6.14 // indirect - github.com/smartcontractkit/ocr2vrf v0.0.0-20230425184732-a793ac75f0a3 // indirect + github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 // indirect + github.com/smartcontractkit/ocr2keepers v0.6.15 // indirect + github.com/smartcontractkit/ocr2vrf v0.0.0-20230510102715-c58be582bf19 // indirect github.com/smartcontractkit/sqlx v1.3.5-0.20210805004948-4be295aacbeb // indirect - github.com/smartcontractkit/wsrpc v0.6.2-0.20230317160629-382a1ac921d8 // indirect + github.com/smartcontractkit/wsrpc v0.7.2 // indirect github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.9.2 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/cobra v1.6.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.14.0 // indirect github.com/status-im/keycard-go v0.2.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.3 github.com/subosito/gotenv v1.4.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tendermint/btcd v0.1.1 // indirect @@ -295,6 +301,7 @@ require ( github.com/tidwall/pretty v1.2.0 // indirect github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/ugorji/go/codec v1.2.11 // indirect github.com/umbracle/ethgo v0.1.3 // indirect @@ -312,25 +319,26 @@ require ( go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.24.0 // indirect go.starlark.net v0.0.0-20220817180228-f738f5508c12 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.10.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 - golang.org/x/crypto v0.7.0 // indirect - golang.org/x/exp v0.0.0-20230307190834-24139beb5833 // indirect + golang.org/x/arch v0.3.0 // indirect + golang.org/x/crypto v0.9.0 // indirect + golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/mod v0.9.0 // indirect - golang.org/x/net v0.9.0 // indirect + golang.org/x/mod v0.10.0 // indirect + golang.org/x/net v0.10.0 // indirect golang.org/x/oauth2 v0.6.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.7.0 // indirect + golang.org/x/sync v0.2.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.7.0 // indirect + golang.org/x/tools v0.9.1 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect gonum.org/v1/gonum v0.12.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 // indirect + google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect google.golang.org/grpc v1.53.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/guregu/null.v4 v4.0.0 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 8420372af..f54c612e2 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -38,8 +38,9 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= -contrib.go.opencensus.io/exporter/stackdriver v0.13.4 h1:ksUxwH3OD5sxkjzEqGxNTl+Xjsmu3BnC/300MhSVTSc= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= +contrib.go.opencensus.io/exporter/stackdriver v0.13.5 h1:TNaexHK16gPUoc7uzELKOU7JULqccn1NDuqUxmxSqfo= +contrib.go.opencensus.io/exporter/stackdriver v0.13.5/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -51,8 +52,9 @@ github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -65,7 +67,7 @@ github.com/CosmWasm/wasmvm v1.1.1 h1:0xtdrmmsP9fibe+x42WcMkp5aQ738BICgcH3FNVLzm4 github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Depado/ginprom v1.7.4 h1:4cV9RYKIkT28tZhBDam0p8me2RLypxS0in5Jw4zbcgg= +github.com/Depado/ginprom v1.7.11 h1:qOhxW/NJZkNkkG4TQrzAZklX8SUTjTfLA73zIUNIpww= github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= @@ -73,9 +75,9 @@ github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETF github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= -github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac h1:TQ2m26VW06Df1P82Ed/jZhBtf13pReWyl2XQ8hy+J08= github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac/go.mod h1:FTk2+xybtQe5X+oNFx+a0n5EeZMD9Nc+LCH4fxFwrEE= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= @@ -100,13 +102,13 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/ava-labs/coreth v0.11.0-rc.4 h1:oYZMWZcXYa4dH2hQBIAH/DD0rL2cB3btPGdabpCH5Ug= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= +github.com/avast/retry-go/v4 v4.3.4 h1:pHLkL7jvCvP317I8Ge+Km2Yhntv3SdkJm7uekkqbKhM= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/constructs-go/constructs/v10 v10.1.255 h1:5hARfEmhBqHSTQf/C3QLA3sWOxO2Dfja0iA1W7ZcI7g= @@ -117,8 +119,8 @@ github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.4 h1:wj3BFPrTw8yYgA1OlMqvUk95nc8OMv3cvBSF5erT2W4= +github.com/benbjohnson/clock v1.3.4/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= @@ -143,6 +145,9 @@ github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtE github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bxcodec/faker v2.0.1+incompatible h1:P0KUpUw5w6WJXwrPfv35oc91i4d8nf40Nwln+M/+faA= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.8.6 h1:aUgO9S8gvdN6SyW2EhIpAw5E4ChworywIEndZCkCVXk= +github.com/bytedance/sonic v1.8.6/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2 v2.7.5 h1:rvc39Ol6z3MvaBzXkxFC6Nfsnixq/dRypushKDd7Nc0= github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2 v2.7.5/go.mod h1:R/pdNYDYFQk+tuuOo7QES1kkv6OLmp5ze2XBZQIVffM= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= @@ -159,13 +164,15 @@ github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNS github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657 h1:CyuI+igIjadM/GRnE2o0q+WCwipDh0n2cUYFPAvxziM= github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657/go.mod h1:JRiumF+RFsH1mrrP8FUsi9tExPylKkO/oSRWeQEUdLE= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cfssl v0.0.0-20190726000631-633726f6bcb7 h1:Puu1hUwfps3+1CUzYdAZXijuvLuRMirgiXdf3zsM2Ig= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -253,7 +260,6 @@ github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70d github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= @@ -264,13 +270,10 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/duo-labs/webauthn v0.0.0-20210727191636-9f1b88ef44cc h1:mLNknBMRNrYNf16wFFUyhSAe1tISZN7oAfal4CZ2OxY= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= -github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= @@ -284,8 +287,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/ethereum/go-ethereum v1.11.5 h1:3M1uan+LAUvdn+7wCEFrcMM4LJTeuxDrPTg/f31a5QQ= -github.com/ethereum/go-ethereum v1.11.5/go.mod h1:it7x0DWnTDMfVFdXcU6Ti4KEFQynLHVRarcSlPr0HBo= +github.com/ethereum/go-ethereum v1.12.0 h1:bdnhLPtqETd4m3mS8BGMNvBTf36bO5bx/hxE2zljOa0= +github.com/ethereum/go-ethereum v1.12.0/go.mod h1:/oo2X/dZLJjf2mJ6YT9wcWxa4nNJDBKDBU6sFIpx1Gs= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -301,6 +304,7 @@ github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8 github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= @@ -310,7 +314,7 @@ github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -345,8 +349,8 @@ github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NB github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/gin-gonic/gin v1.8.2 h1:UzKToD9/PoFj/V4rvlKqTRKnQYyz8Sc1MJlv4JHPtvY= -github.com/gin-gonic/gin v1.8.2/go.mod h1:qw5AYuDrzRTnhvusDsrov+fDIxp9Dleuu12h8nfB398= +github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= +github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= @@ -362,8 +366,8 @@ github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -377,14 +381,13 @@ github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2Kv github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= -github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI= +github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= @@ -395,11 +398,13 @@ github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-webauthn/revoke v0.1.9 h1:gSJ1ckA9VaKA2GN4Ukp+kiGTk1/EXtaDb1YE8RknbS0= +github.com/go-webauthn/webauthn v0.8.2 h1:8KLIbpldjz9KVGHfqEgJNbkhd7bbRXhNw4QWFJE15oA= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= -github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -452,14 +457,14 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/certificate-transparency-go v1.0.21 h1:Yf1aXowfZ2nuboBsg7iYGLmwsOARdV86pfH3g95wXmE= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -481,6 +486,7 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/go-tpm v0.3.3 h1:P/ZFNBZYXRxc+z7i5uyd8VP7MaDteuLZInzrH2idRGo= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -503,8 +509,8 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 h1:CqYfpuYIjnlNxM3msdyPRKabhXZWbKjf3Q8BWROFBso= +github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= @@ -557,7 +563,8 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v1.2.2 h1:ihRI7YFwcZdiSD7SIenIhHfQH3OuDvWerAUBZbeQS3M= +github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I= +github.com/hashicorp/go-hclog v1.4.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -566,7 +573,8 @@ github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHh github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.9 h1:ESiK220/qE0aGxWdzKIvRH69iLiuN/PjoLTm69RoWtU= +github.com/hashicorp/go-plugin v1.4.9/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -580,8 +588,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= +github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -589,12 +597,13 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce h1:7UnVY3T/ZnHUrfviiAgIUjg2PXxsQfs5bphsG8F7Keo= +github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8= +github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= @@ -603,8 +612,8 @@ github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3 github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= @@ -720,6 +729,7 @@ github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZl github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -760,6 +770,9 @@ github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47e github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= @@ -783,14 +796,14 @@ github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awS github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a h1:dHCfT5W7gghzPtfsW488uPmEOm85wewI+ypUwibyTdU= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/leodido/go-urn v1.2.2 h1:7z68G0FCGvDk646jz1AelTYNYWrTNm0bEcFAo147wt4= +github.com/leodido/go-urn v1.2.2/go.mod h1:kUaIbLZWttglzwNuG0pgsh5vuV6u2YcGBYz1hIPjtOQ= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.8 h1:3fdt97i/cwSU83+E0hZTC/Xpc9mTZxc6UWSCRcSbxiE= -github.com/lib/pq v1.10.8/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= github.com/libp2p/go-addr-util v0.0.2 h1:7cWK5cdA5x72jX0g8iLrQWm5TRJZ6CzGdPEhWj7plWU= github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= @@ -1015,6 +1028,7 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -1029,11 +1043,11 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= +github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= @@ -1167,6 +1181,7 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1190,8 +1205,8 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/image-spec v1.1.0-rc3 h1:fzg1mXZFj8YdPeNkRXMg+zb88BFV0Ys52cJydRwBkb8= +github.com/opencontainers/runc v1.1.7 h1:y2EZDS8sNng4Ksf0GUYNhKbTShZJPJg1FiXJNH/uoCk= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= @@ -1201,11 +1216,12 @@ github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= +github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= @@ -1235,8 +1251,9 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/pyroscope-io/client v0.7.0 h1:LWuuqPQ1oa6x7BnmUOuo/aGwdX85QGhWZUBYWWW3zdk= -github.com/pyroscope-io/client v0.7.0/go.mod h1:4h21iOU4pUOq0prKyDlvYRL+SCKsBc5wKiEtV+rJGqU= +github.com/prometheus/prometheus v0.43.1 h1:Z/Z0S0CoPUVtUnHGokFksWMssSw2Y1Ir9NnWS1pPWU0= +github.com/pyroscope-io/client v0.7.1 h1:yFRhj3vbgjBxehvxQmedmUWJQ4CAfCHhn+itPsuWsHw= +github.com/pyroscope-io/client v0.7.1/go.mod h1:4h21iOU4pUOq0prKyDlvYRL+SCKsBc5wKiEtV+rJGqU= github.com/pyroscope-io/godeltaprof v0.1.0 h1:UBqtjt0yZi4jTxqZmLAs34XG6ycS3vUTlhEUSq4NHLE= github.com/pyroscope-io/godeltaprof v0.1.0/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= @@ -1244,15 +1261,15 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5X github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -1270,6 +1287,7 @@ github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNl github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/rwtodd/Go.Sed v0.0.0-20210816025313-55464686f9ef/go.mod h1:8AEUvGVi2uQ5b24BIhcr0GCcpd/RNAFWaN2CJFrWIIQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= @@ -1298,30 +1316,30 @@ github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0 github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ= github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= -github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3 h1:6RsuA0LBbC/6DgTYzg659Pw7GKktubj1GzTcB/VNC44= -github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-cosmos v0.1.7-0.20230424184432-20550926ba07 h1:LBjS7F3Xy9jYlgiEMMMU5f+i/v7oZ97MYseyF6aY7ts= +github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e h1:XY8DncHICYQ1WDVpoXM7Tv3tztNHa1/DctDlSmqgU10= +github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= +github.com/smartcontractkit/chainlink-cosmos v0.4.0 h1:xYLAcJJIm0cyMtYtMaosO45bykEwcwQOmZz3mz46Y2A= github.com/smartcontractkit/chainlink-env v0.3.29 h1:hcIw/BeuB0wKiiE3umAUNBZzWkHO24XF3OW9xSrlMbI= github.com/smartcontractkit/chainlink-env v0.3.29/go.mod h1:9c0Czq4a6wZKY20BcoAlK29DnejQIiLo/MwKYtSFnHk= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230424181359-6cb4dc745ec7 h1:uLPs52VF4VLmNCeC4T398nAVjcmS1KIzt6ZK6iERZ/4= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230424181359-6cb4dc745ec7/go.mod h1:3E3PXaMEl2gADk/DTkbOxsvtpDcJ5ZSyW+vt0TjsEH0= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230424191709-c9fec8c08e1b h1:CJIPaIwlmV5GFSf9Of1Qnpud3gBAeRiT049IiZNzR2g= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 h1:d2WiCTnsCtA16KVabnX3E9SZH1irp2/d0MLT0/UI3XY= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086/go.mod h1:zfUba6Okm7zTBxap24I78Vq9z+twHmjXSMBAl2C2Qgc= +github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230518143827-0b7a6e43719c h1:pM7FH+S92F7Xa/VSfbIs941FDKqSmo9pYeUBWHl1Pq0= github.com/smartcontractkit/chainlink-testing-framework v1.11.5 h1:gYSnOQhLxgE0mxwnv015nNnPgH9kcosx+AzPboEFo38= github.com/smartcontractkit/chainlink-testing-framework v1.11.5/go.mod h1:0ktPcDE5fFSvNewsaHuC4tGVaiCMQsl5RN/cWO5k0rg= github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20230420131147-ce3c53a39d07 h1:UW3llKpFIfVmtu5F1GDLz0S4cze9Un46k15M+JDXSCU= github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20230420131147-ce3c53a39d07/go.mod h1:dvEXSlzknoPm6YFaa0Ubs57CPFjhBbXnMju7WgiqiD4= -github.com/smartcontractkit/chainlink/v2 v2.1.0-beta0.0.20230427051455-edb338fd2536 h1:uomhVY2qYciWK0XuFqEpqbKdVmYAFQCDw6Lg8L8Hrt0= -github.com/smartcontractkit/chainlink/v2 v2.1.0-beta0.0.20230427051455-edb338fd2536/go.mod h1:adNwYzBQKE0gRgebDch8E0Iu5ke0/PmoRCQe638cjSw= -github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc h1:aSCDAai0Dmbhp/KHTtJnC/EJcaEz4CAO80SKRzRZiQA= -github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= -github.com/smartcontractkit/ocr2keepers v0.6.14 h1:Rg+SYd8PCyd4CcCetwnRKjVEQsHVsV6QOaWcLhi+6sg= -github.com/smartcontractkit/ocr2keepers v0.6.14/go.mod h1:gqIksJFzdXFsHfGdCWm1uTxbwvAltgcwcaqIgAStC1A= -github.com/smartcontractkit/ocr2vrf v0.0.0-20230425184732-a793ac75f0a3 h1:K71txN76a7Tf9teLEpoxsMhWXi36W2gDeicLqqa6/p0= -github.com/smartcontractkit/ocr2vrf v0.0.0-20230425184732-a793ac75f0a3/go.mod h1:NKkp8yf3trq+hJe/gn2Q1dd4abZvcYavUKPzYJCgVew= +github.com/smartcontractkit/chainlink/v2 v2.2.0-mercury-20230527.0.20230531010141-105ba3488387 h1:6TI7kysRc1vZuRDPdU66Gvfc8k51Bh5qYf3YWPP/NFI= +github.com/smartcontractkit/chainlink/v2 v2.2.0-mercury-20230527.0.20230531010141-105ba3488387/go.mod h1:euMZJQMObJPBsmMD8Klvy/xvXg/hOzbU2D4eal8phiM= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 h1:/Gel/U5eIZ/BGGr25OrHaXiVDTAJ5DYX5+UlXp3q7Gg= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= +github.com/smartcontractkit/ocr2keepers v0.6.15 h1:dFhg+qT+tc6b3G8N4qnAHuHe8N0m8CSA8g4YGSeTGPo= +github.com/smartcontractkit/ocr2keepers v0.6.15/go.mod h1:gqIksJFzdXFsHfGdCWm1uTxbwvAltgcwcaqIgAStC1A= +github.com/smartcontractkit/ocr2vrf v0.0.0-20230510102715-c58be582bf19 h1:RxaC+V34UEP2u/riXfcvWPZEglri4UsfQi5joUObZ08= +github.com/smartcontractkit/ocr2vrf v0.0.0-20230510102715-c58be582bf19/go.mod h1:AZbOisIoA3cOUku8suZ+KWBnzbRiafmhi7UKiXoezrk= github.com/smartcontractkit/sqlx v1.3.5-0.20210805004948-4be295aacbeb h1:OMaBUb4X9IFPLbGbCHsMU+kw/BPCrewaVwWGIBc0I4A= github.com/smartcontractkit/sqlx v1.3.5-0.20210805004948-4be295aacbeb/go.mod h1:HNUu4cJekUdsJbwRBCiOybtkPJEfGRELQPe2tkoDEyk= -github.com/smartcontractkit/wsrpc v0.6.2-0.20230317160629-382a1ac921d8 h1:Wn9X8mOQoQzzh1kBK22EDDgyXAfVjDlFlqUQW5kyyGo= -github.com/smartcontractkit/wsrpc v0.6.2-0.20230317160629-382a1ac921d8/go.mod h1:sj7QX2NQibhkhxTfs3KOhAj/5xwgqMipTvJVSssT9i0= +github.com/smartcontractkit/wsrpc v0.7.2 h1:iBXzMeg7vc5YoezIQBq896y25BARw7OKbhrb6vPbtRQ= +github.com/smartcontractkit/wsrpc v0.7.2/go.mod h1:sj7QX2NQibhkhxTfs3KOhAj/5xwgqMipTvJVSssT9i0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= @@ -1336,8 +1354,8 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= @@ -1373,8 +1391,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= @@ -1411,6 +1430,8 @@ github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYm github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= @@ -1425,7 +1446,7 @@ github.com/umbracle/ethgo v0.1.3/go.mod h1:g9zclCLixH8liBI27Py82klDkW7Oo33AxUOr+ github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 h1:10Nbw6cACsnQm7r34zlpJky+IzxVLRk6MKTS2d3Vp0E= github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722/go.mod h1:c8J0h9aULj2i3umrfyestM6jCq0LK0U6ly6bWy96nd4= github.com/unrolled/secure v0.0.0-20190624173513-716474489ad3 h1:Is9lt18DCzmbgaXowC/LuO1prTus8ejfgMn+GelBuHs= -github.com/urfave/cli v1.22.12 h1:igJgVw1JdKH+trcLWLeLwZjU9fEfPesQ+9/e4MQ44S8= +github.com/urfave/cli v1.22.13 h1:wsLILXG8qCJNse/qAgLNf23737Cx05GflHg/PJGe1Ok= github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= @@ -1500,8 +1521,8 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= @@ -1509,8 +1530,8 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/ratelimit v0.2.0 h1:UQE2Bgi7p2B85uP5dC2bbRtig0C+OeNRnNEafLjsLPA= go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= @@ -1523,6 +1544,9 @@ go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1558,10 +1582,9 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1572,8 +1595,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1601,8 +1624,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1655,14 +1678,13 @@ golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1688,8 +1710,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1759,7 +1781,6 @@ golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1767,7 +1788,9 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1775,15 +1798,16 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1870,8 +1894,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1955,8 +1979,8 @@ google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 h1:znp6mq/drrY+6khTAlJUDNFFcDGV2ENLYKpMq8SyCds= -google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -2043,7 +2067,6 @@ gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= @@ -2077,6 +2100,7 @@ k8s.io/kubectl v0.25.4/go.mod h1:CKMrQ67Bn2YCP26tZStPQGq62zr9pvzEf65A0navm8k= k8s.io/utils v0.0.0-20221107191617-1a15be271d1d h1:0Smp/HP1OH4Rvhe+4B8nWGERtlqAGSftbSbbmm45oFs= k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/controller-runtime v0.13.0 h1:iqa5RNciy7ADWnIc8QxCbOX5FEKVR3uxVxKHRMc2WIQ= diff --git a/integration-tests/smoke/ocr2_test.go b/integration-tests/smoke/ocr2_test.go index 8f3e355fc..341821e5c 100644 --- a/integration-tests/smoke/ocr2_test.go +++ b/integration-tests/smoke/ocr2_test.go @@ -60,5 +60,4 @@ func TestOCRBasic(t *testing.T) { err = actions.TeardownSuite(t, testState.Common.Env, utils.ProjectRoot, testState.Cc.ChainlinkNodes, nil, zapcore.ErrorLevel) require.NoError(t, err, "Error tearing down environment") }) - } diff --git a/integration-tests/soak/ocr2_test.go b/integration-tests/soak/ocr2_test.go index aff0cdcba..bbc8bd803 100644 --- a/integration-tests/soak/ocr2_test.go +++ b/integration-tests/soak/ocr2_test.go @@ -5,7 +5,6 @@ import ( "flag" "fmt" "testing" - "time" "github.com/smartcontractkit/chainlink-starknet/integration-tests/common" "github.com/smartcontractkit/chainlink-starknet/ops/gauntlet" @@ -42,7 +41,6 @@ func TestOCRSoak(t *testing.T) { } err = testState.Sg.SetupNetwork(testState.Common.L2RPCUrl) require.NoError(t, err, "Setting up network should not fail") - time.Sleep(8 * time.Hour) err = testState.DeployGauntlet(0, 100000000000, decimals, "auto", 1, 1) require.NoError(t, err, "Deploying contracts should not fail") if !testState.Common.Testnet { diff --git a/integration-tests/test.Dockerfile b/integration-tests/test.Dockerfile index d7f87f52a..aaf35e838 100644 --- a/integration-tests/test.Dockerfile +++ b/integration-tests/test.Dockerfile @@ -2,6 +2,7 @@ FROM nixos/nix:latest ARG SUITES=smoke soak ENV NIX_USER_CONF_FILES=/repo/nix.conf +ENV PATH="/repo/cairo-build/bin:/repo/scarb-build/bin:${PATH}" COPY . /repo/ WORKDIR /repo diff --git a/monitoring/go.mod b/monitoring/go.mod index 6b92ae82d..5daccf3d6 100644 --- a/monitoring/go.mod +++ b/monitoring/go.mod @@ -4,16 +4,15 @@ go 1.20 require ( github.com/prometheus/client_golang v1.14.0 - github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3 - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230422214339-5fee8d7f3f82 + github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230508053614-9f2fd5fd4ff1 - github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc + github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 github.com/stretchr/testify v1.8.2 go.uber.org/multierr v1.9.0 ) require ( - github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect @@ -23,6 +22,7 @@ require ( github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/ethereum/go-ethereum v1.11.5 // indirect + github.com/fatih/color v1.7.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-stack/stack v1.8.1 // indirect @@ -31,11 +31,18 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect + github.com/hashicorp/go-hclog v0.14.1 // indirect + github.com/hashicorp/go-plugin v1.4.9 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/holiman/uint256 v1.2.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/linkedin/goavro/v2 v2.12.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77 // indirect github.com/mr-tron/base58 v1.2.0 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -43,7 +50,6 @@ require ( github.com/prometheus/procfs v0.9.0 // indirect github.com/riferrei/srclient v0.5.4 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.1.1 // indirect - github.com/satori/go.uuid v1.2.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect @@ -52,9 +58,13 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.7.0 // indirect - golang.org/x/exp v0.0.0-20230307190834-24139beb5833 // indirect + golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 // indirect + golang.org/x/net v0.8.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.7.0 // indirect + golang.org/x/text v0.8.0 // indirect + google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 // indirect + google.golang.org/grpc v1.53.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/monitoring/go.sum b/monitoring/go.sum index 319d5b542..5886a6221 100644 --- a/monitoring/go.sum +++ b/monitoring/go.sum @@ -2,8 +2,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= -github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac h1:TQ2m26VW06Df1P82Ed/jZhBtf13pReWyl2XQ8hy+J08= -github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac/go.mod h1:FTk2+xybtQe5X+oNFx+a0n5EeZMD9Nc+LCH4fxFwrEE= github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= github.com/actgardner/gogen-avro/v10 v10.1.0/go.mod h1:o+ybmVjEa27AAr35FRqU98DJu1fXES56uXniYFv4yDA= github.com/actgardner/gogen-avro/v10 v10.2.1/go.mod h1:QUhjeHPchheYmMDni/Nx7VB0RsT/ee8YIgGY/xpEQgQ= @@ -57,6 +55,8 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.11.5 h1:3M1uan+LAUvdn+7wCEFrcMM4LJTeuxDrPTg/f31a5QQ= github.com/ethereum/go-ethereum v1.11.5/go.mod h1:it7x0DWnTDMfVFdXcU6Ti4KEFQynLHVRarcSlPr0HBo= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/frankban/quicktest v1.2.2/go.mod h1:Qh/WofXFeiAFII1aEBu529AtJo6Zg2VHscnEsbBnJ20= github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= @@ -113,6 +113,12 @@ github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWm github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hamba/avro v1.5.6/go.mod h1:3vNT0RLXXpFm2Tb/5KC71ZRJlOroggq1Rcitb6k4Fr8= +github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-plugin v1.4.9 h1:ESiK220/qE0aGxWdzKIvRH69iLiuN/PjoLTm69RoWtU= +github.com/hashicorp/go-plugin v1.4.9/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/heetch/avro v0.3.1/go.mod h1:4xn38Oz/+hiEUTpbVfGVLfvOg0yKLlRP7Q9+gJJILgA= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= @@ -126,6 +132,7 @@ github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSl github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ= github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= +github.com/jhump/protoreflect v1.12.0 h1:1NQ4FpWMgn3by/n1X0fbeKEUxP1wBt7+Oitpv01HR10= github.com/jhump/protoreflect v1.12.0/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= @@ -150,9 +157,18 @@ github.com/linkedin/goavro/v2 v2.10.1/go.mod h1:UgQUb2N/pmueQYH9bfqFioWxzYCZXSfF github.com/linkedin/goavro/v2 v2.11.1/go.mod h1:UgQUb2N/pmueQYH9bfqFioWxzYCZXSfF8Jw03O5sjqA= github.com/linkedin/goavro/v2 v2.12.0 h1:rIQQSj8jdAUlKQh6DttK8wCRv4t4QO09g1C4aBWXslg= github.com/linkedin/goavro/v2 v2.12.0/go.mod h1:KXx+erlq+RPlGSPmLF7xGo6SAbh8sCQ53x064+ioxhk= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77 h1:7GoSOOW2jpsfkntVKaS2rAr1TJqfcxotyaUcuxoZSzg= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -161,6 +177,8 @@ github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/nrwiersma/avro-benchmarks v0.0.0-20210913175520-21aec48c8f76/go.mod h1:iKyFMidsk/sVYONJRE372sJuX/QTRPacU7imPqqsu7g= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -188,21 +206,20 @@ github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZV github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= github.com/santhosh-tekuri/jsonschema/v5 v5.1.1 h1:lEOLY2vyGIqKWUI9nzsOJRV3mb3WC9dXYORsLEUcoeY= github.com/santhosh-tekuri/jsonschema/v5 v5.1.1/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3 h1:6RsuA0LBbC/6DgTYzg659Pw7GKktubj1GzTcB/VNC44= -github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230422214339-5fee8d7f3f82 h1:FX7LW/czuotFwzfK3UavL7HkKQv6fn/5wzcZASdKWQ0= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230422214339-5fee8d7f3f82/go.mod h1:3E3PXaMEl2gADk/DTkbOxsvtpDcJ5ZSyW+vt0TjsEH0= -github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc h1:aSCDAai0Dmbhp/KHTtJnC/EJcaEz4CAO80SKRzRZiQA= -github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= +github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e h1:XY8DncHICYQ1WDVpoXM7Tv3tztNHa1/DctDlSmqgU10= +github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 h1:d2WiCTnsCtA16KVabnX3E9SZH1irp2/d0MLT0/UI3XY= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086/go.mod h1:zfUba6Okm7zTBxap24I78Vq9z+twHmjXSMBAl2C2Qgc= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 h1:/Gel/U5eIZ/BGGr25OrHaXiVDTAJ5DYX5+UlXp3q7Gg= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= @@ -236,8 +253,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -255,6 +272,8 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -268,8 +287,10 @@ golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -279,6 +300,7 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -288,6 +310,7 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -306,6 +329,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20220503193339-ba3ae3f07e29/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 h1:znp6mq/drrY+6khTAlJUDNFFcDGV2ENLYKpMq8SyCds= +google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -314,6 +339,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/ops/charts/devnet/templates/deployment.yaml b/ops/charts/devnet/templates/deployment.yaml index 10735f7a8..80fc165ac 100644 --- a/ops/charts/devnet/templates/deployment.yaml +++ b/ops/charts/devnet/templates/deployment.yaml @@ -21,6 +21,22 @@ spec: - name: vol hostPath: path: /dumps + - name: cairo-build + emptyDir: {} + initContainers: + - name: cairo-download + image: appropriate/curl + command: ["/bin/sh"] + args: + - "-c" + - | + mkdir -p cairo-build + curl -L --output release.tgz https://github.com/starkware-libs/cairo/releases/download/v1.0.0-rc0/release-x86_64-unknown-linux-musl.tar.gz + tar xzf release.tgz + mv cairo/* cairo-build/ + volumeMounts: + - name: cairo-build + mountPath: /cairo-build containers: - name: {{ .Chart.Name }} volumeMounts: @@ -29,8 +45,10 @@ spec: {{- if eq .Values.real_node true }} image: "{{ .Values.repository | default "eqlabs/pathfinder"}}:{{ .Values.tag | default "v0.1.8-alpha"}}" {{- else }} - image: "{{ .Values.repository | default "shardlabs/starknet-devnet"}}:{{ .Values.tag | default "0.5.0"}}" - args: ["--lite-mode", "--port", {{ .Values.service.internalPort | quote}}, "--seed", {{ .Values.seed | quote}}] + - name: cairo-build + mountPath: /cairo-build + image: "{{ .Values.repository | default "shardlabs/starknet-devnet"}}:{{ .Values.tag | default "0.5.2"}}" + args: ["--sierra-compiler-path", "/cairo-build/bin/starknet-sierra-compile", "--lite-mode", "--port", {{ .Values.service.internalPort | quote}}, "--seed", {{ .Values.seed | quote}}] {{- end }} imagePullPolicy: IfNotPresent {{- if eq .Values.real_node true }} @@ -55,14 +73,18 @@ spec: httpGet: path: /is_alive port: {{ .Values.service.externalPort }} - initialDelaySeconds: 1 + initialDelaySeconds: 5 periodSeconds: 30 + timeoutSeconds: 300 + failureThreshold: 10 readinessProbe: httpGet: path: /is_alive port: {{ .Values.service.externalPort }} - initialDelaySeconds: 2 - periodSeconds: 1 + initialDelaySeconds: 5 + periodSeconds: 30 + timeoutSeconds: 300 + failureThreshold: 10 resources: requests: memory: {{ .Values.resources.requests.memory }} diff --git a/ops/devnet/environment.go b/ops/devnet/environment.go index 093faec4c..4858ee022 100644 --- a/ops/devnet/environment.go +++ b/ops/devnet/environment.go @@ -71,7 +71,7 @@ func defaultProps() map[string]any { "starknet-dev": map[string]any{ "image": map[string]any{ "image": "shardlabs/starknet-devnet", - "version": "v0.3.5", + "version": "v0.5.2", }, "resources": map[string]any{ "requests": map[string]any{ diff --git a/ops/go.mod b/ops/go.mod index 0ed202c01..50467d77d 100644 --- a/ops/go.mod +++ b/ops/go.mod @@ -5,24 +5,24 @@ go 1.20 require ( github.com/go-resty/resty/v2 v2.7.0 github.com/rs/zerolog v1.29.1 - github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3 + github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e github.com/smartcontractkit/chainlink-env v0.3.29 - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230508053614-9f2fd5fd4ff1 + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230530233948-90c8af98011e github.com/smartcontractkit/chainlink-testing-framework v1.11.5 ) require ( - github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect + github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect - github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect + github.com/VictoriaMetrics/fastcache v1.10.0 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/avast/retry-go v3.0.0+incompatible // indirect github.com/aws/constructs-go/constructs/v10 v10.1.255 // indirect github.com/aws/jsii-runtime-go v1.75.0 // indirect - github.com/benbjohnson/clock v1.3.0 // indirect + github.com/benbjohnson/clock v1.3.4 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2 v2.7.5 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chai2010/gettext-go v1.0.2 // indirect @@ -32,13 +32,15 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect - github.com/ethereum/go-ethereum v1.11.5 // indirect + github.com/ethereum/go-ethereum v1.12.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect github.com/fatih/camelcase v1.0.0 // indirect + github.com/fatih/color v1.15.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/fvbommel/sortorder v1.0.2 // indirect + github.com/getsentry/sentry-go v0.19.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-ole/go-ole v1.2.6 // indirect @@ -58,8 +60,11 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect - github.com/holiman/uint256 v1.2.0 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/hashicorp/go-hclog v1.4.0 // indirect + github.com/hashicorp/go-plugin v1.4.9 // indirect + github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce // indirect + github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect @@ -67,8 +72,10 @@ require ( github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/moby/spdystream v0.2.0 // indirect github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect @@ -77,45 +84,52 @@ require ( github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/onsi/ginkgo/v2 v2.5.0 // indirect + github.com/onsi/gomega v1.24.1 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.15.0 // indirect + github.com/prometheus/client_golang v1.15.1 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect + github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/russross/blackfriday v1.6.0 // indirect - github.com/satori/go.uuid v1.2.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230422214339-5fee8d7f3f82 // indirect - github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc // indirect + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 // indirect + github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 // indirect github.com/spf13/cobra v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.8.2 // indirect - github.com/tklauser/go-sysconf v0.3.10 // indirect - github.com/tklauser/numcpus v0.5.0 // indirect + github.com/stretchr/testify v1.8.3 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect + github.com/tklauser/numcpus v0.6.0 // indirect github.com/xlab/treeprint v1.1.0 // indirect github.com/yuin/goldmark v1.4.13 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect go.starlark.net v0.0.0-20220817180228-f738f5508c12 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.9.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.7.0 // indirect - golang.org/x/exp v0.0.0-20230307190834-24139beb5833 // indirect + golang.org/x/crypto v0.9.0 // indirect + golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/mod v0.9.0 // indirect - golang.org/x/net v0.9.0 // indirect + golang.org/x/mod v0.10.0 // indirect + golang.org/x/net v0.10.0 // indirect golang.org/x/oauth2 v0.6.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.7.0 // indirect + golang.org/x/sync v0.2.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.7.0 // indirect + golang.org/x/tools v0.9.1 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect + google.golang.org/grpc v1.53.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect diff --git a/ops/go.sum b/ops/go.sum index 62a97d282..ffe65af32 100644 --- a/ops/go.sum +++ b/ops/go.sum @@ -1,19 +1,20 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= -github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac h1:TQ2m26VW06Df1P82Ed/jZhBtf13pReWyl2XQ8hy+J08= -github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac/go.mod h1:FTk2+xybtQe5X+oNFx+a0n5EeZMD9Nc+LCH4fxFwrEE= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= +github.com/VictoriaMetrics/fastcache v1.10.0 h1:5hDJnLsKLpnUEToub7ETuRu8RCkb40woBZAUiKonXzY= +github.com/VictoriaMetrics/fastcache v1.10.0/go.mod h1:tjiYeEfYXCqacuvYw/7UoDIeJaNxq6132xHICNP77w8= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= @@ -22,13 +23,13 @@ github.com/aws/constructs-go/constructs/v10 v10.1.255 h1:5hARfEmhBqHSTQf/C3QLA3s github.com/aws/constructs-go/constructs/v10 v10.1.255/go.mod h1:DCdBSjN04Ck2pajCacTD4RKFqSA7Utya8d62XreYctI= github.com/aws/jsii-runtime-go v1.75.0 h1:NhpUfyiL7/wsRuUekFsz8FFBCYLfPD/l61kKg9kL/a4= github.com/aws/jsii-runtime-go v1.75.0/go.mod h1:TKCyrtM0pygEPo4rDZzbMSDNCDNTSYSN6/mGyHI6O3I= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.4 h1:wj3BFPrTw8yYgA1OlMqvUk95nc8OMv3cvBSF5erT2W4= +github.com/benbjohnson/clock v1.3.4/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= -github.com/btcsuite/btcd/btcec/v2 v2.2.1 h1:xP60mv8fvp+0khmrN0zTdPC3cNm24rfeE6lh2R/Yv3E= -github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= +github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bxcodec/faker v2.0.1+incompatible h1:P0KUpUw5w6WJXwrPfv35oc91i4d8nf40Nwln+M/+faA= @@ -37,6 +38,7 @@ github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2 v2.7.5/go.mod h1:R/pdNYDYFQk+tuuOo7 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= @@ -70,7 +72,6 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2U github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= @@ -80,8 +81,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.11.5 h1:3M1uan+LAUvdn+7wCEFrcMM4LJTeuxDrPTg/f31a5QQ= -github.com/ethereum/go-ethereum v1.11.5/go.mod h1:it7x0DWnTDMfVFdXcU6Ti4KEFQynLHVRarcSlPr0HBo= +github.com/ethereum/go-ethereum v1.12.0 h1:bdnhLPtqETd4m3mS8BGMNvBTf36bO5bx/hxE2zljOa0= +github.com/ethereum/go-ethereum v1.12.0/go.mod h1:/oo2X/dZLJjf2mJ6YT9wcWxa4nNJDBKDBU6sFIpx1Gs= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -91,13 +92,20 @@ github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f h1:Wl78ApPPB2 github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fvbommel/sortorder v1.0.2 h1:mV4o8B2hKboCdkJm+a7uX/SIpZob4JzUpc5GGnM45eo= github.com/fvbommel/sortorder v1.0.2/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= -github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= +github.com/getsentry/sentry-go v0.19.0 h1:BcCH3CN5tXt5aML+gwmbFwVptLLQA+eT866fCO9wVOM= +github.com/getsentry/sentry-go v0.19.0/go.mod h1:y3+lGEFEFexZtpbG1GUE2WD/f9zGyKYwpEqryTOC/nE= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= @@ -117,6 +125,7 @@ github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPr github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -140,7 +149,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= @@ -160,6 +170,7 @@ github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -171,16 +182,25 @@ github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I= +github.com/hashicorp/go-hclog v1.4.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-plugin v1.4.9 h1:ESiK220/qE0aGxWdzKIvRH69iLiuN/PjoLTm69RoWtU= +github.com/hashicorp/go-plugin v1.4.9/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce h1:7UnVY3T/ZnHUrfviiAgIUjg2PXxsQfs5bphsG8F7Keo= +github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= -github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8= +github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= @@ -203,16 +223,21 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= +github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= @@ -231,11 +256,26 @@ github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjW github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= -github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.5.0 h1:TRtrvv2vdQqzkwrQ1ke6vtXf7IK34RBUJafIy1wMwls= +github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= +github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -244,8 +284,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= -github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= +github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= @@ -255,32 +295,33 @@ github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJf github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3 h1:6RsuA0LBbC/6DgTYzg659Pw7GKktubj1GzTcB/VNC44= -github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= +github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e h1:XY8DncHICYQ1WDVpoXM7Tv3tztNHa1/DctDlSmqgU10= +github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-env v0.3.29 h1:hcIw/BeuB0wKiiE3umAUNBZzWkHO24XF3OW9xSrlMbI= github.com/smartcontractkit/chainlink-env v0.3.29/go.mod h1:9c0Czq4a6wZKY20BcoAlK29DnejQIiLo/MwKYtSFnHk= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230422214339-5fee8d7f3f82 h1:FX7LW/czuotFwzfK3UavL7HkKQv6fn/5wzcZASdKWQ0= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230422214339-5fee8d7f3f82/go.mod h1:3E3PXaMEl2gADk/DTkbOxsvtpDcJ5ZSyW+vt0TjsEH0= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 h1:d2WiCTnsCtA16KVabnX3E9SZH1irp2/d0MLT0/UI3XY= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086/go.mod h1:zfUba6Okm7zTBxap24I78Vq9z+twHmjXSMBAl2C2Qgc= github.com/smartcontractkit/chainlink-testing-framework v1.11.5 h1:gYSnOQhLxgE0mxwnv015nNnPgH9kcosx+AzPboEFo38= github.com/smartcontractkit/chainlink-testing-framework v1.11.5/go.mod h1:0ktPcDE5fFSvNewsaHuC4tGVaiCMQsl5RN/cWO5k0rg= -github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc h1:aSCDAai0Dmbhp/KHTtJnC/EJcaEz4CAO80SKRzRZiQA= -github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 h1:/Gel/U5eIZ/BGGr25OrHaXiVDTAJ5DYX5+UlXp3q7Gg= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= @@ -299,16 +340,17 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= -github.com/tklauser/numcpus v0.5.0 h1:ooe7gN0fg6myJ0EKoTAf5hebTZrH52px3New/D9iJ+A= -github.com/tklauser/numcpus v0.5.0/go.mod h1:OGzpTxpcIMNGYQdit2BYL1pvk/dSOaJWjKoflh+RQjo= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= +github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= +github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= @@ -324,21 +366,21 @@ github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20220817180228-f738f5508c12 h1:xOBJXWGEDwU5xSDxH6macxO11Us0AH2fTa9rmsbbF7g= go.starlark.net v0.0.0-20220817180228-f738f5508c12/go.mod h1:VZcBMdr3cT3PnBoWunTabuSEXwVAH+ZJ5zxfs3AdASk= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -347,10 +389,11 @@ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -359,13 +402,17 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= @@ -376,35 +423,51 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= @@ -418,13 +481,15 @@ golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -437,6 +502,8 @@ google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -445,6 +512,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -463,22 +532,24 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/ops/scripts/devnet-hardhat.sh b/ops/scripts/devnet-hardhat.sh index d0b6724ce..70b8c2cb5 100755 --- a/ops/scripts/devnet-hardhat.sh +++ b/ops/scripts/devnet-hardhat.sh @@ -1,10 +1,28 @@ #!/usr/bin/env bash # TODO: this script needs to be replaced with a predefined K8s enviroment +set -euo pipefail + cpu_struct=`arch`; echo $cpu_struct; -node --version; +git_root="$(git rev-parse --show-toplevel)" +cairo_build_path="${git_root}/cairo-build" +cairo_sierra_compile_path="${cairo_build_path}/bin/starknet-sierra-compile" + +cairo_checkout_path="${git_root}/vendor/cairo" +cairo_compiler_manifest="${cairo_checkout_path}/Cargo.toml" + +if [ -f "${cairo_sierra_compile_path}" ]; then + docker_volume="${cairo_build_path}:/cairo-build" + startup_args="starknet-devnet --lite-mode --host 0.0.0.0 --sierra-compiler-path /cairo-build/bin/starknet-sierra-compile" +elif [ -f "${cairo_compiler_manifest}" ]; then + docker_volume="${cairo_checkout_path}:/cairo" + startup_args="(wget https://sh.rustup.rs -O - | sh -s -- -y) && apk add gmp-dev g++ gcc libffi-dev && PATH=\"/root/.cargo/bin:\${PATH}\" starknet-devnet --lite-mode --host 0.0.0.0 --cairo-compiler-manifest /cairo/Cargo.toml" +else + echo "No Cargo.toml; did you checkout the cairo git submodule?" + exit 1 +fi # Clean up first bash "$(dirname -- "$0";)/devnet-hardhat-down.sh" @@ -13,11 +31,53 @@ echo "Checking CPU structure..." if [[ $cpu_struct == *"arm"* ]] then echo "Starting arm devnet container..." - docker run -p 5050:5050 -p 8545:8545 -d --name chainlink-starknet.starknet-devnet shardlabs/starknet-devnet:0.5.0-arm; + container_version="0.5.2-arm" else echo "Starting i386 devnet container..." - docker run -p 5050:5050 -p 8545:8545 -d --name chainlink-starknet.starknet-devnet shardlabs/starknet-devnet:0.5.0; + container_version="0.5.2" fi +echo "Starting starknet-devnet: ${startup_args}" + +# we need to replace the entrypoint because starknet-devnet's docker builds at 0.5.1 don't include cargo or gcc. +docker run \ + -p 127.0.0.1:5050:5050 \ + -p 127.0.0.1:8545:8545 \ + -d \ + --name chainlink-starknet.starknet-devnet \ + --volume "${docker_volume}" \ + --entrypoint sh \ + "shardlabs/starknet-devnet:${container_version}" \ + -c "${startup_args}" + echo "Starting hardhat..." docker run --net container:chainlink-starknet.starknet-devnet -d --name chainlink-starknet.hardhat ethereumoptimism/hardhat-node:nightly + +# starknet-devnet startup is slow and requires compiling cairo. +echo "Waiting for starknet-devnet to become ready.." +start_time=$(date +%s) +prev_output="" +while true +do + output=$(docker logs chainlink-starknet.starknet-devnet 2>&1) + if [[ "${output}" != "${prev_output}" ]]; then + echo -n "${output#$prev_output}" + prev_output="${output}" + fi + + if [[ $output == *"Listening"* ]]; then + echo "" + echo "starknet-devnet is ready." + exit 0 + fi + + current_time=$(date +%s) + elapsed_time=$((current_time - start_time)) + + if (( elapsed_time > 600 )); then + echo "Error: Command did not become ready within 600 seconds" + exit 1 + fi + + sleep 3 +done diff --git a/ops/test_helpers.go b/ops/test_helpers.go index 443cd9308..9b2eebfa5 100644 --- a/ops/test_helpers.go +++ b/ops/test_helpers.go @@ -1,6 +1,8 @@ package ops import ( + "math/big" + "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/txm" ) @@ -8,8 +10,10 @@ var ( // seed = 0 keys for starknet-devnet PrivateKeys0Seed = txm.PrivateKeys0Seed - DevnetClassHash = txm.DevnetClassHash - DevnetSalt = txm.DevnetSalt + // devnet key derivation + // https://github.com/Shard-Labs/starknet-devnet/blob/master/starknet_devnet/account.py + DevnetClassHash, _ = new(big.Int).SetString("1803505466663265559571280894381905521939782500874858933595227108099796801620", 10) + DevnetSalt = big.NewInt(20) ) // OCR2Config Default config for OCR2 for starknet @@ -59,7 +63,7 @@ var TestOCR2Config = OCR2Config{ DeltaProgressNanoseconds: 8000000000, DeltaResendNanoseconds: 30000000000, DeltaRoundNanoseconds: 3000000000, - DeltaGraceNanoseconds: 500000000, + DeltaGraceNanoseconds: 1000000000, DeltaStageNanoseconds: 20000000000, RMax: 5, S: []int{1, 2}, @@ -70,13 +74,13 @@ var TestOCR2Config = OCR2Config{ AlphaReportPpb: 0, AlphaAcceptInfinite: false, AlphaAcceptPpb: 0, - DeltaCNanoseconds: 0, + DeltaCNanoseconds: 1000000000, }, MaxDurationQueryNanoseconds: 0, MaxDurationObservationNanoseconds: 1000000000, - MaxDurationReportNanoseconds: 200000000, - MaxDurationShouldAcceptFinalizedReportNanoseconds: 200000000, - MaxDurationShouldTransmitAcceptedReportNanoseconds: 200000000, + MaxDurationReportNanoseconds: 2000000000, + MaxDurationShouldAcceptFinalizedReportNanoseconds: 2000000000, + MaxDurationShouldTransmitAcceptedReportNanoseconds: 2000000000, // ConfigPublicKeys: cfgKeys, // user defined }, OffchainConfigVersion: 2, diff --git a/packages-ts/integration-multisig/hardhat.config.ts b/packages-ts/integration-multisig/hardhat.config.ts index 43ab083ea..88fe0f990 100644 --- a/packages-ts/integration-multisig/hardhat.config.ts +++ b/packages-ts/integration-multisig/hardhat.config.ts @@ -1,5 +1,7 @@ +import path from 'path' import { HardhatUserConfig } from 'hardhat/types' import '@shardlabs/starknet-hardhat-plugin' +import { prepareHardhatArtifacts } from '../../contracts/test/setup' /** * @type import('hardhat/config').HardhatUserConfig @@ -22,6 +24,12 @@ const config: HardhatUserConfig = { args: ['--cairo-compiler-manifest', '../../vendor/cairo/Cargo.toml'], }, }, + mocha: { + timeout: 10000000, + rootHooks: { + beforeAll: prepareHardhatArtifacts, + }, + }, paths: { sources: './solidity', starknetSources: '../../contracts/src', diff --git a/packages-ts/integration-multisig/test/Multisig.test.ts b/packages-ts/integration-multisig/test/Multisig.test.ts index d9a7b114a..47bb825ab 100644 --- a/packages-ts/integration-multisig/test/Multisig.test.ts +++ b/packages-ts/integration-multisig/test/Multisig.test.ts @@ -56,7 +56,6 @@ describe('Multisig integration tests', function () { to: multisig.address, function_selector: selector, calldata: [newThreshold], - nonce, } { diff --git a/packages-ts/starknet-gauntlet-argent/src/commands/account/initialize.ts b/packages-ts/starknet-gauntlet-argent/src/commands/account/initialize.ts index 5a7643c25..4ebb8f441 100644 --- a/packages-ts/starknet-gauntlet-argent/src/commands/account/initialize.ts +++ b/packages-ts/starknet-gauntlet-argent/src/commands/account/initialize.ts @@ -38,7 +38,9 @@ const beforeExecute: BeforeExecute = ( input, deps, ) => async () => { - deps.logger.info(`About to deploy an Account Contract with public key ${input.contract[0]}`) + deps.logger.info( + `About to deploy an Argent Account Contract with public key ${input.contract[0]}`, + ) if (input.user.privateKey) { await deps.prompt(`The generated private key will be shown next, continue?`) deps.logger.line() diff --git a/packages-ts/starknet-gauntlet-emergency-protocol/src/commands/sequencerUptimeFeed/inspection/inspection.ts b/packages-ts/starknet-gauntlet-emergency-protocol/src/commands/sequencerUptimeFeed/inspection/inspection.ts index f69a99ccf..76e582ef2 100644 --- a/packages-ts/starknet-gauntlet-emergency-protocol/src/commands/sequencerUptimeFeed/inspection/inspection.ts +++ b/packages-ts/starknet-gauntlet-emergency-protocol/src/commands/sequencerUptimeFeed/inspection/inspection.ts @@ -27,7 +27,7 @@ const makeComparisionData = (provider: IStarknetProvider) => async ( toCompare: null result: QueryResult }> => { - let [{ round: latest_round_data }]: { round: Round }[] = results + let [latest_round_data] = results for (var key in latest_round_data) { if (latest_round_data.hasOwnProperty(key)) { diff --git a/packages-ts/starknet-gauntlet-emergency-protocol/test/commands/sequencerUptimeFeed.test.ts b/packages-ts/starknet-gauntlet-emergency-protocol/test/commands/sequencerUptimeFeed.test.ts index ac9443940..23c4eede6 100644 --- a/packages-ts/starknet-gauntlet-emergency-protocol/test/commands/sequencerUptimeFeed.test.ts +++ b/packages-ts/starknet-gauntlet-emergency-protocol/test/commands/sequencerUptimeFeed.test.ts @@ -15,7 +15,7 @@ describe('Sequencer Uptime Feed Contract', () => { beforeAll(async () => { network = await startNetwork() - }, 15000) + }, TIMEOUT) // deploy uptime feed contract beforeEach(async () => { diff --git a/packages-ts/starknet-gauntlet-ocr2/src/lib/contracts.ts b/packages-ts/starknet-gauntlet-ocr2/src/lib/contracts.ts index e805938a4..350807796 100644 --- a/packages-ts/starknet-gauntlet-ocr2/src/lib/contracts.ts +++ b/packages-ts/starknet-gauntlet-ocr2/src/lib/contracts.ts @@ -2,7 +2,7 @@ import { loadContract } from '@chainlink/starknet-gauntlet' export enum CONTRACT_LIST { OCR2 = 'Aggregator', - ACCESS_CONTROLLER = 'SimpleWriteAccessController', + ACCESS_CONTROLLER = 'AccessController', PROXY = 'AggregatorProxy', AGGREGATOR_CONSUMER = 'AggregatorConsumer', } diff --git a/packages-ts/starknet-gauntlet-ocr2/test/commands/access_controller.test.ts b/packages-ts/starknet-gauntlet-ocr2/test/commands/access_controller.test.ts index bf5f4e38b..d4a0348cd 100644 --- a/packages-ts/starknet-gauntlet-ocr2/test/commands/access_controller.test.ts +++ b/packages-ts/starknet-gauntlet-ocr2/test/commands/access_controller.test.ts @@ -11,7 +11,7 @@ describe('Access Controller Contract', () => { beforeAll(async () => { network = await startNetwork() - }, 15000) + }, TIMEOUT) it( 'Deployment', diff --git a/packages-ts/starknet-gauntlet-oz/src/commands/account/deploy.ts b/packages-ts/starknet-gauntlet-oz/src/commands/account/deploy.ts index 806f4306c..433876894 100644 --- a/packages-ts/starknet-gauntlet-oz/src/commands/account/deploy.ts +++ b/packages-ts/starknet-gauntlet-oz/src/commands/account/deploy.ts @@ -40,7 +40,7 @@ const beforeExecute: BeforeExecute = ( input, deps, ) => async () => { - deps.logger.info(`About to deploy an Account Contract with: + deps.logger.info(`About to deploy an OZ 0.x Account Contract with: public key: ${input.contract[0]} salt: ${input.user.salt || 'randomly generated'}`) if (input.user.privateKey) { diff --git a/packages-ts/starknet-gauntlet-oz/src/lib/contracts.ts b/packages-ts/starknet-gauntlet-oz/src/lib/contracts.ts index 3a5b4cae6..448860258 100644 --- a/packages-ts/starknet-gauntlet-oz/src/lib/contracts.ts +++ b/packages-ts/starknet-gauntlet-oz/src/lib/contracts.ts @@ -1,11 +1,21 @@ +import fs from 'fs' +import { json } from 'starknet' import BN from 'bn.js' -import { loadContract } from '@chainlink/starknet-gauntlet' export enum CONTRACT_LIST { ACCOUNT = 'Account', } -export const accountContractLoader = () => loadContract(CONTRACT_LIST.ACCOUNT) +export const accountContractLoader = () => { + return { + contract: json.parse( + fs.readFileSync( + `${__dirname}/../../../../node_modules/@chainlink-dev/starkgate-open-zeppelin/artifacts/0.5.0/Account.cairo/Account.json`, + 'utf8', + ), + ), + } +} // use bignumber libraries to assert addresses are equal // handles prepending 0s diff --git a/packages-ts/starknet-gauntlet-oz/test/commands/account.test.ts b/packages-ts/starknet-gauntlet-oz/test/commands/account.test.ts index 46ea659fc..4289e1a37 100644 --- a/packages-ts/starknet-gauntlet-oz/test/commands/account.test.ts +++ b/packages-ts/starknet-gauntlet-oz/test/commands/account.test.ts @@ -7,8 +7,7 @@ import { startNetwork, IntegratedDevnet, } from '@chainlink/starknet-gauntlet/test/utils' -import { loadContract } from '@chainlink/starknet-gauntlet' -import { CONTRACT_LIST, equalAddress } from '../../src/lib/contracts' +import { accountContractLoader, CONTRACT_LIST, equalAddress } from '../../src/lib/contracts' import { Contract } from 'starknet' describe('OZ Account Contract', () => { @@ -18,7 +17,7 @@ describe('OZ Account Contract', () => { beforeAll(async () => { network = await startNetwork() - }, 15000) + }, TIMEOUT) it( 'Deployment', @@ -31,9 +30,9 @@ describe('OZ Account Contract', () => { contractAddress = report.responses[0].contract publicKey = report.data.publicKey - const { contract: oz } = loadContract(CONTRACT_LIST.ACCOUNT) + const { contract: oz } = accountContractLoader() const ozContract = new Contract(oz.abi, contractAddress, makeProvider(LOCAL_URL).provider) - const onChainPubKey = await ozContract.get_public_key() + const { publicKey: onChainPubKey } = await ozContract.getPublicKey() expect(onChainPubKey).toEqual(BigInt(publicKey)) }, TIMEOUT, diff --git a/packages-ts/starknet-gauntlet-token/src/lib/contracts.ts b/packages-ts/starknet-gauntlet-token/src/lib/contracts.ts index 17c2229bf..ea3da82a0 100644 --- a/packages-ts/starknet-gauntlet-token/src/lib/contracts.ts +++ b/packages-ts/starknet-gauntlet-token/src/lib/contracts.ts @@ -1,7 +1,7 @@ import { loadContract } from '@chainlink/starknet-gauntlet' export enum CONTRACT_LIST { - TOKEN = 'LinkToken', + TOKEN = 'token', } -export const tokenContractLoader = () => loadContract(CONTRACT_LIST.TOKEN) +export const tokenContractLoader = () => loadContract('LinkToken') diff --git a/packages-ts/starknet-gauntlet-token/test/commands/token.test.ts b/packages-ts/starknet-gauntlet-token/test/commands/token.test.ts index 83a9c90e9..d643043a2 100644 --- a/packages-ts/starknet-gauntlet-token/test/commands/token.test.ts +++ b/packages-ts/starknet-gauntlet-token/test/commands/token.test.ts @@ -32,7 +32,7 @@ describe('Token Contract', () => { defaultAccount = '0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a' defaultPk = '0xe3e70682c2094cac629f6fbed82c07cd' defaultBalance = 0 - }, 15000) + }, TIMEOUT) it( 'Deploy OZ Account', diff --git a/packages-ts/starknet-gauntlet/test/commands/execute.test.ts b/packages-ts/starknet-gauntlet/test/commands/execute.test.ts index 75bd7b3f5..1702faf4f 100644 --- a/packages-ts/starknet-gauntlet/test/commands/execute.test.ts +++ b/packages-ts/starknet-gauntlet/test/commands/execute.test.ts @@ -4,11 +4,10 @@ import { devnetPrivateKey, loadExampleContract, registerExecuteCommand, + TIMEOUT, } from '../utils' import { IntegratedDevnet, startNetwork } from '../utils/network' -const TIMEOUT = 100000 - let account: string = devnetAccount0Address let privateKey: string = devnetPrivateKey @@ -71,7 +70,7 @@ describe('Execute with network', () => { beforeAll(async () => { network = await startNetwork({ seed: 0 }) - }, 15000) + }, TIMEOUT) it( 'Command deploy execution', diff --git a/packages-ts/starknet-gauntlet/test/utils/index.ts b/packages-ts/starknet-gauntlet/test/utils/index.ts index ed433ebc5..748e1086d 100644 --- a/packages-ts/starknet-gauntlet/test/utils/index.ts +++ b/packages-ts/starknet-gauntlet/test/utils/index.ts @@ -38,7 +38,7 @@ export const noopLogger: typeof logger = { export const noopPrompt: typeof prompt = async () => {} -export const TIMEOUT = 200000 +export const TIMEOUT = 900000 export const LOCAL_URL = 'http://127.0.0.1:5050/' export const devnetPrivateKey = '0xe3e70682c2094cac629f6fbed82c07cd' export const devnetAccount0Address = diff --git a/packages-ts/starknet-gauntlet/test/utils/network.ts b/packages-ts/starknet-gauntlet/test/utils/network.ts index 9d0edc028..0a1baac1f 100644 --- a/packages-ts/starknet-gauntlet/test/utils/network.ts +++ b/packages-ts/starknet-gauntlet/test/utils/network.ts @@ -1,4 +1,5 @@ import { ChildProcess, spawn } from 'child_process' +import fs from 'fs' import path from 'path' export abstract class IntegratedDevnet { @@ -52,16 +53,19 @@ class VenvDevnet extends IntegratedDevnet { protected spawnChildProcess(): Promise { return new Promise((resolve, reject) => { + const cairoSierraCompilerBuildPath = path.join( + __dirname, + '../../../../cairo-build/bin/starknet-sierra-compile', + ) const cargoManifest = path.join(__dirname, '../../../../vendor/cairo/Cargo.toml') - let args = [ - '--port', - this.port, - '--gas-price', - '1', - '--lite-mode', - '--cairo-compiler-manifest', - cargoManifest, - ] + const args = ['--port', this.port, '--gas-price', '1', '--lite-mode'] + if (fs.existsSync(cairoSierraCompilerBuildPath)) { + args.push('--sierra-compiler-path', cairoSierraCompilerBuildPath) + } else if (fs.existsSync(cargoManifest)) { + args.push('--cairo-compiler-manifest', cargoManifest) + } else { + return reject(new Error('Could not find cairo package')) + } if (this.opts?.seed) { args.push('--seed', this.opts.seed.toString()) } else { diff --git a/relayer/go.mod b/relayer/go.mod index e85602d3b..a81c0ca59 100644 --- a/relayer/go.mod +++ b/relayer/go.mod @@ -3,14 +3,14 @@ module github.com/smartcontractkit/chainlink-starknet/relayer go 1.20 require ( - github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 github.com/pkg/errors v0.9.1 - github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3 - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230422214339-5fee8d7f3f82 - github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc + github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 + github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 github.com/stretchr/testify v1.8.2 - golang.org/x/exp v0.0.0-20230307190834-24139beb5833 + go.uber.org/zap v1.24.0 + golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 ) require ( @@ -20,19 +20,26 @@ require ( github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/ethereum/go-ethereum v1.11.5 // indirect + github.com/fatih/color v1.7.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/gogo/protobuf v1.3.3 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect + github.com/hashicorp/go-hclog v0.14.1 // indirect + github.com/hashicorp/go-plugin v1.4.9 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/holiman/uint256 v1.2.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77 // indirect github.com/mr-tron/base58 v1.2.0 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/satori/go.uuid v1.2.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect @@ -40,9 +47,12 @@ require ( github.com/yusufpapurcu/wmi v1.2.2 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.9.0 // indirect - go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect golang.org/x/sys v0.7.0 // indirect + golang.org/x/text v0.8.0 // indirect + google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 // indirect + google.golang.org/grpc v1.53.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/relayer/go.sum b/relayer/go.sum index e5fd23f07..544788b24 100644 --- a/relayer/go.sum +++ b/relayer/go.sum @@ -1,8 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= -github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac h1:TQ2m26VW06Df1P82Ed/jZhBtf13pReWyl2XQ8hy+J08= -github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac/go.mod h1:FTk2+xybtQe5X+oNFx+a0n5EeZMD9Nc+LCH4fxFwrEE= github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -35,6 +33,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.11.5 h1:3M1uan+LAUvdn+7wCEFrcMM4LJTeuxDrPTg/f31a5QQ= github.com/ethereum/go-ethereum v1.11.5/go.mod h1:it7x0DWnTDMfVFdXcU6Ti4KEFQynLHVRarcSlPr0HBo= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= @@ -52,23 +52,30 @@ github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaW github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-plugin v1.4.9 h1:ESiK220/qE0aGxWdzKIvRH69iLiuN/PjoLTm69RoWtU= +github.com/hashicorp/go-plugin v1.4.9/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -78,11 +85,22 @@ github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7y github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77 h1:7GoSOOW2jpsfkntVKaS2rAr1TJqfcxotyaUcuxoZSzg= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -97,21 +115,20 @@ github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJf github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3 h1:6RsuA0LBbC/6DgTYzg659Pw7GKktubj1GzTcB/VNC44= -github.com/smartcontractkit/caigo v0.0.0-20230508053235-41120ca1f9f3/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230422214339-5fee8d7f3f82 h1:FX7LW/czuotFwzfK3UavL7HkKQv6fn/5wzcZASdKWQ0= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230422214339-5fee8d7f3f82/go.mod h1:3E3PXaMEl2gADk/DTkbOxsvtpDcJ5ZSyW+vt0TjsEH0= -github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc h1:aSCDAai0Dmbhp/KHTtJnC/EJcaEz4CAO80SKRzRZiQA= -github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= +github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e h1:XY8DncHICYQ1WDVpoXM7Tv3tztNHa1/DctDlSmqgU10= +github.com/smartcontractkit/caigo v0.0.0-20230530082629-53a5a4bdb25e/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 h1:d2WiCTnsCtA16KVabnX3E9SZH1irp2/d0MLT0/UI3XY= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086/go.mod h1:zfUba6Okm7zTBxap24I78Vq9z+twHmjXSMBAl2C2Qgc= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 h1:/Gel/U5eIZ/BGGr25OrHaXiVDTAJ5DYX5+UlXp3q7Gg= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= @@ -140,8 +157,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -156,6 +173,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -165,12 +184,15 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -178,6 +200,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -195,12 +218,17 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 h1:znp6mq/drrY+6khTAlJUDNFFcDGV2ENLYKpMq8SyCds= +google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/relayer/pkg/chainlink/config/config.go b/relayer/pkg/chainlink/config/config.go index 14268abaa..80de5c8bb 100644 --- a/relayer/pkg/chainlink/config/config.go +++ b/relayer/pkg/chainlink/config/config.go @@ -13,9 +13,8 @@ var DefaultConfigSet = ConfigSet{ OCR2CachePollPeriod: 5 * time.Second, OCR2CacheTTL: time.Minute, RequestTimeout: 10 * time.Second, - TxTimeout: time.Minute, - TxSendFrequency: 5 * time.Second, - TxMaxBatchSize: 100, + TxTimeout: 10 * time.Second, + ConfirmationPoll: 5 * time.Second, } type ConfigSet struct { @@ -26,9 +25,8 @@ type ConfigSet struct { RequestTimeout time.Duration // txm config - TxTimeout time.Duration - TxSendFrequency time.Duration - TxMaxBatchSize int + TxTimeout time.Duration + ConfirmationPoll time.Duration } type Config interface { @@ -46,8 +44,7 @@ type Chain struct { OCR2CacheTTL *utils.Duration RequestTimeout *utils.Duration TxTimeout *utils.Duration - TxSendFrequency *utils.Duration - TxMaxBatchSize *int64 + ConfirmationPoll *utils.Duration } func (c *Chain) SetDefaults() { @@ -63,12 +60,8 @@ func (c *Chain) SetDefaults() { if c.TxTimeout == nil { c.TxTimeout = utils.MustNewDuration(DefaultConfigSet.TxTimeout) } - if c.TxSendFrequency == nil { - c.TxSendFrequency = utils.MustNewDuration(DefaultConfigSet.TxSendFrequency) - } - if c.TxMaxBatchSize == nil { - i := int64(DefaultConfigSet.TxMaxBatchSize) - c.TxMaxBatchSize = &i + if c.ConfirmationPoll == nil { + c.ConfirmationPoll = utils.MustNewDuration(DefaultConfigSet.ConfirmationPoll) } } diff --git a/relayer/pkg/chainlink/keys/key.go b/relayer/pkg/chainlink/keys/key.go deleted file mode 100644 index 456dae041..000000000 --- a/relayer/pkg/chainlink/keys/key.go +++ /dev/null @@ -1,104 +0,0 @@ -package keys - -import ( - crypto_rand "crypto/rand" - "encoding/hex" - "fmt" - "io" - "math/big" - - "github.com/smartcontractkit/caigo" -) - -// Raw represents the Stark private key -type Raw []byte - -// Key gets the Key -func (raw Raw) Key() Key { - k := Key{} - var err error - - k.priv = new(big.Int).SetBytes(raw) - k.pub.X, k.pub.Y, err = caigo.Curve.PrivateToPoint(k.priv) - if err != nil { - panic(err) // key not generated - } - return k -} - -// String returns description -func (raw Raw) String() string { - return "" -} - -// GoString wraps String() -func (raw Raw) GoString() string { - return raw.String() -} - -var _ fmt.GoStringer = &Key{} - -type PublicKey struct { - X, Y *big.Int -} - -// Key represents Starknet key -type Key struct { - priv *big.Int - pub PublicKey -} - -// New creates new Key -func New() (Key, error) { - return newFrom(crypto_rand.Reader) -} - -// MustNewInsecure return Key if no error -func MustNewInsecure(reader io.Reader) Key { - key, err := newFrom(reader) - if err != nil { - panic(err) - } - return key -} - -func newFrom(reader io.Reader) (Key, error) { - return GenerateKey(reader) -} - -// ID gets Key ID -func (key Key) ID() string { - return key.StarkKeyStr() -} - -// StarkKeyStr is the starknet public key associated to the private key -// it is the X component of the ECDSA pubkey and used in the deployment of the account contract -// this func is used in exporting it via CLI and API -func (key Key) StarkKeyStr() string { - return "0x" + hex.EncodeToString(PubKeyToStarkKey(key.pub)) -} - -// Raw from private key -func (key Key) Raw() Raw { - return key.priv.Bytes() -} - -// String is the print-friendly format of the Key -func (key Key) String() string { - return fmt.Sprintf("StarknetKey{PrivateKey: , StarkKey: %s}", key.StarkKeyStr()) -} - -// GoString wraps String() -func (key Key) GoString() string { - return key.String() -} - -// ToPrivKey returns the key usable for signing. -func (key Key) ToPrivKey() *big.Int { - return key.priv -} - -// PublicKey copies public key object -func (key Key) PublicKey() PublicKey { - return key.pub -} diff --git a/relayer/pkg/chainlink/keys/keystore.go b/relayer/pkg/chainlink/keys/keystore.go deleted file mode 100644 index 4990bafd9..000000000 --- a/relayer/pkg/chainlink/keys/keystore.go +++ /dev/null @@ -1,7 +0,0 @@ -package keys - -//go:generate mockery --name Keystore --output ./mocks/ --case=underscore --filename keystore.go - -type Keystore interface { - Get(id string) (Key, error) -} diff --git a/relayer/pkg/chainlink/keys/mocks/keystore.go b/relayer/pkg/chainlink/keys/mocks/keystore.go deleted file mode 100644 index 1fe142f61..000000000 --- a/relayer/pkg/chainlink/keys/mocks/keystore.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" - - keys "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/keys" -) - -// Keystore is an autogenerated mock type for the Keystore type -type Keystore struct { - mock.Mock -} - -// Get provides a mock function with given fields: id -func (_m *Keystore) Get(id string) (keys.Key, error) { - ret := _m.Called(id) - - var r0 keys.Key - if rf, ok := ret.Get(0).(func(string) keys.Key); ok { - r0 = rf(id) - } else { - r0 = ret.Get(0).(keys.Key) - } - - var r1 error - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(id) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -type mockConstructorTestingTNewKeystore interface { - mock.TestingT - Cleanup(func()) -} - -// NewKeystore creates a new instance of Keystore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewKeystore(t mockConstructorTestingTNewKeystore) *Keystore { - mock := &Keystore{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/relayer/pkg/chainlink/keys/ocr2key.go b/relayer/pkg/chainlink/keys/ocr2key.go deleted file mode 100644 index bfc004cc2..000000000 --- a/relayer/pkg/chainlink/keys/ocr2key.go +++ /dev/null @@ -1,143 +0,0 @@ -package keys - -import ( - "bytes" - "io" - "math/big" - - "github.com/NethermindEth/juno/pkg/crypto/pedersen" - "github.com/smartcontractkit/caigo" - "github.com/pkg/errors" - - "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/ocr2/medianreport" - "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2/types" -) - -var _ ocrtypes.OnchainKeyring = &OCR2Key{} - -type OCR2Key struct { - Key -} - -func NewOCR2Key(material io.Reader) (*OCR2Key, error) { - k, err := GenerateKey(material) - - return &OCR2Key{k}, err -} - -func (sk *OCR2Key) PublicKey() ocrtypes.OnchainPublicKey { - return PubKeyToStarkKey(sk.pub) -} - -func ReportToSigData(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) (*big.Int, error) { - var dataArray []*big.Int - - rawReportContext := medianreport.RawReportContext(reportCtx) - dataArray = append(dataArray, new(big.Int).SetBytes(rawReportContext[0][:])) - dataArray = append(dataArray, new(big.Int).SetBytes(rawReportContext[1][:])) - dataArray = append(dataArray, new(big.Int).SetBytes(rawReportContext[2][:])) - - // split report into separate felts for hashing - splitReport, err := medianreport.SplitReport(report) - if err != nil { - return &big.Int{}, err - } - for i := 0; i < len(splitReport); i++ { - dataArray = append(dataArray, new(big.Int).SetBytes(splitReport[i])) - } - - hash := pedersen.ArrayDigest(dataArray...) - return hash, nil -} - -func (sk *OCR2Key) Sign(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { - hash, err := ReportToSigData(reportCtx, report) - if err != nil { - return []byte{}, err - } - - r, s, err := caigo.Curve.Sign(hash, sk.priv) - if err != nil { - return []byte{}, err - } - - // enforce s <= N/2 to prevent signature malleability - if s.Cmp(new(big.Int).Rsh(caigo.Curve.N, 1)) > 0 { - s.Sub(caigo.Curve.N, s) - } - - // encoding: public key (32 bytes) + r (32 bytes) + s (32 bytes) - buff := bytes.NewBuffer([]byte(sk.PublicKey())) - if _, err := buff.Write(starknet.PadBytes(r.Bytes(), byteLen)); err != nil { - return []byte{}, err - } - if _, err := buff.Write(starknet.PadBytes(s.Bytes(), byteLen)); err != nil { - return []byte{}, err - } - - out := buff.Bytes() - if len(out) != sk.MaxSignatureLength() { - return []byte{}, errors.Errorf("unexpected signature size, got %d want %d", len(out), sk.MaxSignatureLength()) - } - return out, nil -} - -func (sk *OCR2Key) Verify(publicKey ocrtypes.OnchainPublicKey, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signature []byte) bool { - // check valid signature length - if len(signature) != sk.MaxSignatureLength() { - return false - } - - // convert OnchainPublicKey (starkkey) into ecdsa public keys (prepend 2 or 3 to indicate +/- Y coord) - var keys [2]PublicKey - keys[0].X = new(big.Int).SetBytes(publicKey) - keys[0].Y = caigo.Curve.GetYCoordinate(keys[0].X) - - // When there is no point with the provided x-coordinate, the GetYCoordinate function returns the nil value. - if keys[0].Y == nil { - return false - } - - keys[1].X = keys[0].X - keys[1].Y = new(big.Int).Mul(keys[0].Y, big.NewInt(-1)) - - hash, err := ReportToSigData(reportCtx, report) - if err != nil { - return false - } - - r := new(big.Int).SetBytes(signature[32:64]) - s := new(big.Int).SetBytes(signature[64:]) - - // Only allow canonical signatures to avoid signature malleability. Verify s <= N/2 - if s.Cmp(new(big.Int).Rsh(caigo.Curve.N, 1)) == 1 { - return false - } - - return caigo.Curve.Verify(hash, r, s, keys[0].X, keys[0].Y) || caigo.Curve.Verify(hash, r, s, keys[1].X, keys[1].Y) -} - -func (sk *OCR2Key) MaxSignatureLength() int { - return 32 + 32 + 32 // publickey + r + s -} - -func (sk *OCR2Key) Marshal() ([]byte, error) { - return starknet.PadBytes(sk.priv.Bytes(), sk.privateKeyLen()), nil -} - -func (sk *OCR2Key) privateKeyLen() int { - // https://github.com/NethermindEth/juno/blob/3e71279632d82689e5af03e26693ca5c58a2376e/pkg/crypto/weierstrass/weierstrass.go#L377 - return 32 -} - -func (sk *OCR2Key) Unmarshal(in []byte) error { - // enforce byte length - if len(in) != sk.privateKeyLen() { - return errors.Errorf("unexpected seed size, got %d want %d", len(in), sk.privateKeyLen()) - } - - sk.Key = Raw(in).Key() - return nil -} diff --git a/relayer/pkg/chainlink/keys/ocr2key_test.go b/relayer/pkg/chainlink/keys/ocr2key_test.go deleted file mode 100644 index b639e3584..000000000 --- a/relayer/pkg/chainlink/keys/ocr2key_test.go +++ /dev/null @@ -1,178 +0,0 @@ -package keys - -import ( - cryptorand "crypto/rand" - "encoding/hex" - "math/big" - "testing" - - junotypes "github.com/NethermindEth/juno/pkg/types" - caigotypes "github.com/smartcontractkit/caigo/types" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -// msg to hash -// [ -// '0x4acf99cb25a4803916f086440c661295b105a485efdc649ac4de9536da25b', // digest -// 1, // epoch_and_round -// 1, // extra_hash -// 1, // timestamp -// '0x00010203000000000000000000000000000000000000000000000000000000', // observers -// 4, // len -// 99, // reports -// 99, -// 99, -// 99, -// 1 juels_per_fee_coin -// ] -// hash 0x1332a8dabaabef63b03438ca50760cb9f5c0292cbf015b2395e50e6157df4e3 -// --> privKey 2137244795266879235401249500471353867704187908407744160927664772020405449078 r 2898571078985034687500959842265381508927681132188252715370774777831313601543 s 1930849708769648077928186998643944706551011476358007177069185543644456022504 pubKey 1118148281956858477519852250235501663092798578871088714409528077622994994907 -// privKey 3571531812827697194985986636869245829152430835021673171507607525908246940354 r 3242770073040892094735101607173275538752888766491356946211654602282309624331 s 2150742645846855766116236144967953798077492822890095121354692808525999221887 pubKey 2445157821578193538289426656074203099996547227497157254541771705133209838679 - -func TestStarknetKeyring_TestVector(t *testing.T) { - var kr1 OCR2Key - bigKey, _ := new(big.Int).SetString("2137244795266879235401249500471353867704187908407744160927664772020405449078", 10) - feltKey := junotypes.BigToFelt(bigKey) - err := kr1.Unmarshal(feltKey.Bytes()) - require.NoError(t, err) - // kr2, err := NewOCR2Key(cryptorand.Reader) - // require.NoError(t, err) - - bytes, err := caigotypes.HexToBytes("0x004acf99cb25a4803916f086440c661295b105a485efdc649ac4de9536da25b") - require.NoError(t, err) - configDigest, err := ocrtypes.BytesToConfigDigest(bytes) - require.NoError(t, err) - - ctx := ocrtypes.ReportContext{ - ReportTimestamp: ocrtypes.ReportTimestamp{ - ConfigDigest: configDigest, - Epoch: 0, - Round: 1, - }, - ExtraHash: [32]byte{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - }, - } - - var report []byte - report = append(report, junotypes.BigToFelt(big.NewInt(1)).Bytes()...) - report = append(report, junotypes.HexToFelt("0x00010203000000000000000000000000000000000000000000000000000000").Bytes()...) - report = append(report, junotypes.BigToFelt(big.NewInt(4)).Bytes()...) - report = append(report, junotypes.BigToFelt(big.NewInt(99)).Bytes()...) - report = append(report, junotypes.BigToFelt(big.NewInt(99)).Bytes()...) - report = append(report, junotypes.BigToFelt(big.NewInt(99)).Bytes()...) - report = append(report, junotypes.BigToFelt(big.NewInt(99)).Bytes()...) - report = append(report, junotypes.BigToFelt(big.NewInt(1)).Bytes()...) - - // check that report hash matches expected - msg, err := ReportToSigData(ctx, report) - require.NoError(t, err) - - expected, err := caigotypes.HexToBytes("0x1332a8dabaabef63b03438ca50760cb9f5c0292cbf015b2395e50e6157df4e3") - require.NoError(t, err) - assert.Equal(t, expected, msg.Bytes()) - - // check that signature matches expected - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - - pub := junotypes.BytesToFelt(sig[0:32]) - r := junotypes.BytesToFelt(sig[32:64]) - s := junotypes.BytesToFelt(sig[64:]) - - bigPubExpected, _ := new(big.Int).SetString("1118148281956858477519852250235501663092798578871088714409528077622994994907", 10) - feltPubExpected := junotypes.BigToFelt(bigPubExpected) - assert.Equal(t, feltPubExpected, pub) - - bigRExpected, _ := new(big.Int).SetString("2898571078985034687500959842265381508927681132188252715370774777831313601543", 10) - feltRExpected := junotypes.BigToFelt(bigRExpected) - assert.Equal(t, feltRExpected, r) - - // test for malleability - otherS, _ := new(big.Int).SetString("1930849708769648077928186998643944706551011476358007177069185543644456022504", 10) - bigSExpected, _ := new(big.Int).SetString("1687653079896483135769135784451125398975732275358080312084893914240056843079", 10) - - feltSExpected := junotypes.BigToFelt(bigSExpected) - assert.NotEqual(t, otherS, s, "signature not in canonical form") - assert.Equal(t, feltSExpected, s) -} - -func TestStarknetKeyring_Sign_Verify(t *testing.T) { - kr1, err := NewOCR2Key(cryptorand.Reader) - require.NoError(t, err) - kr2, err := NewOCR2Key(cryptorand.Reader) - require.NoError(t, err) - - digest := "00044e5d4f35325e464c87374b13c512f60e09d1236dd902f4bef4c9aedd7300" - bytes, err := hex.DecodeString(digest) - require.NoError(t, err) - configDigest, err := ocrtypes.BytesToConfigDigest(bytes) - require.NoError(t, err) - - ctx := ocrtypes.ReportContext{ - ReportTimestamp: ocrtypes.ReportTimestamp{ - ConfigDigest: configDigest, - Epoch: 1, - Round: 1, - }, - ExtraHash: [32]byte{ - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - }, - } - report := ocrtypes.Report{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 91, 43, 83, // observations_timestamp - 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // observers - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, // len - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 150, 2, 210, // observation 1 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 150, 2, 211, // observation 2 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 224, 182, 179, 167, 100, 0, 0, // juels per fee coin (1 with 18 decimal places) - } - - t.Run("can verify", func(t *testing.T) { - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - result := kr2.Verify(kr1.PublicKey(), ctx, report, sig) - require.True(t, result) - }) - - t.Run("invalid sig", func(t *testing.T) { - result := kr2.Verify(kr1.PublicKey(), ctx, report, []byte{0x01}) - require.False(t, result) - - longSig := [100]byte{} - result = kr2.Verify(kr1.PublicKey(), ctx, report, longSig[:]) - require.False(t, result) - }) - - t.Run("invalid pubkey", func(t *testing.T) { - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - - pk := []byte{0x01} - result := kr2.Verify(pk, ctx, report, sig) - require.False(t, result) - - pk = big.NewInt(int64(31337)).Bytes() - result = kr2.Verify(pk, ctx, report, sig) - require.False(t, result) - }) -} - -func TestStarknetKeyring_Marshal(t *testing.T) { - kr1, err := NewOCR2Key(cryptorand.Reader) - require.NoError(t, err) - m, err := kr1.Marshal() - require.NoError(t, err) - kr2 := OCR2Key{} - err = kr2.Unmarshal(m) - require.NoError(t, err) - assert.True(t, kr1.priv.Cmp(kr2.priv) == 0) - - // Invalid seed size should error - require.Error(t, kr2.Unmarshal([]byte{0x01})) -} diff --git a/relayer/pkg/chainlink/keys/utils.go b/relayer/pkg/chainlink/keys/utils.go deleted file mode 100644 index 57ec986ab..000000000 --- a/relayer/pkg/chainlink/keys/utils.go +++ /dev/null @@ -1,60 +0,0 @@ -package keys - -import ( - "crypto/rand" - "fmt" - "io" - "math/big" - - "github.com/NethermindEth/juno/pkg/crypto/pedersen" - "github.com/smartcontractkit/caigo" - - "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet" -) - -// constants -var ( - byteLen = 32 -) - -// PubKeyToContract implements the pubkey to deployed account given contract hash + salt -func PubKeyToAccount(pubkey PublicKey, classHash, salt *big.Int) []byte { - hash := pedersen.ArrayDigest( - new(big.Int).SetBytes([]byte("STARKNET_CONTRACT_ADDRESS")), - big.NewInt(0), - salt, // salt - classHash, // classHash - pedersen.ArrayDigest(pubkey.X), - ) - - // pad big.Int to 32 bytes if needed - return starknet.PadBytes(hash.Bytes(), byteLen) -} - -// PubToStarkKey implements the pubkey to starkkey functionality: https://github.com/0xs34n/starknet.js/blob/cd61356974d355aa42f07a3d63f7ccefecbd913c/src/utils/ellipticCurve.ts#L49 -func PubKeyToStarkKey(pubkey PublicKey) []byte { - return starknet.PadBytes(pubkey.X.Bytes(), byteLen) -} - -// reimplements parts of https://github.com/smartcontractkit/caigo/blob/main/utils.go#L85 -// generate the PK as a pseudo-random number in the interval [1, CurveOrder - 1] -// using io.Reader, and Key struct -func GenerateKey(material io.Reader) (k Key, err error) { - max := new(big.Int).Sub(caigo.Curve.N, big.NewInt(1)) - - k.priv, err = rand.Int(material, max) - if err != nil { - return k, err - } - - k.pub.X, k.pub.Y, err = caigo.Curve.PrivateToPoint(k.priv) - if err != nil { - return k, err - } - - if !caigo.Curve.IsOnCurve(k.pub.X, k.pub.Y) { - return k, fmt.Errorf("key gen is not on stark curve") - } - - return k, nil -} diff --git a/relayer/pkg/chainlink/ocr2/client.go b/relayer/pkg/chainlink/ocr2/client.go index 60a59836d..8cc6bbad8 100644 --- a/relayer/pkg/chainlink/ocr2/client.go +++ b/relayer/pkg/chainlink/ocr2/client.go @@ -7,7 +7,6 @@ import ( "math/big" "time" - junotypes "github.com/NethermindEth/juno/pkg/types" "github.com/pkg/errors" caigogw "github.com/smartcontractkit/caigo/gateway" @@ -67,8 +66,8 @@ func (c *Client) BillingDetails(ctx context.Context, address caigotypes.Hash) (b return bd, errors.New("unexpected result length") } - observationPayment := junotypes.HexToFelt(res[0]).Big() - transmissionPayment := junotypes.HexToFelt(res[1]).Big() + observationPayment := caigotypes.StrToFelt(res[0]).Big() + transmissionPayment := caigotypes.StrToFelt(res[1]).Big() bd, err = NewBillingDetails(observationPayment, transmissionPayment) if err != nil { @@ -94,8 +93,8 @@ func (c *Client) LatestConfigDetails(ctx context.Context, address caigotypes.Has return ccd, errors.New("unexpected result length") } - blockNum := junotypes.HexToFelt(res[1]) - configDigest := junotypes.HexToFelt(res[2]) + blockNum := caigotypes.StrToFelt(res[1]) + configDigest := caigotypes.StrToFelt(res[2]) ccd, err = NewContractConfigDetails(blockNum.Big(), configDigest.Bytes()) if err != nil { @@ -121,15 +120,15 @@ func (c *Client) LatestTransmissionDetails(ctx context.Context, address caigotyp return td, errors.New("unexpected result length") } - digest := junotypes.HexToFelt(res[0]) + digest := caigotypes.StrToFelt(res[0]) configDigest := types.ConfigDigest{} digest.Big().FillBytes(configDigest[:]) - epoch, round := parseEpochAndRound(junotypes.HexToFelt(res[1]).Big()) + epoch, round := parseEpochAndRound(caigotypes.StrToFelt(res[1]).Big()) latestAnswer := starknet.HexToSignedBig(res[2]) - timestampFelt := junotypes.HexToFelt(res[3]) + timestampFelt := caigotypes.StrToFelt(res[3]) // TODO: Int64() can return invalid data if int is too big unixTime := timestampFelt.Big().Int64() latestTimestamp := time.Unix(unixTime, 0) @@ -155,9 +154,9 @@ func (c *Client) LatestRoundData(ctx context.Context, address caigotypes.Hash) ( if err != nil { return round, errors.Wrap(err, "couldn't call the contract with selector latest_round_data") } - felts := []junotypes.Felt{} + felts := []*caigotypes.Felt{} for _, result := range results { - felts = append(felts, junotypes.HexToFelt(result)) + felts = append(felts, caigotypes.StrToFelt(result)) } round, err = NewRoundData(felts) @@ -178,7 +177,7 @@ func (c *Client) LinkAvailableForPayment(ctx context.Context, address caigotypes if len(results) != 1 { return nil, errors.Wrap(err, "insufficient data from selector 'link_available_for_payment'") } - return junotypes.HexToFelt(results[0]).Big(), nil + return caigotypes.StrToFelt(results[0]).Big(), nil } func (c *Client) fetchEventsFromBlock(ctx context.Context, address caigotypes.Hash, eventType string, blockNum uint64) (eventsAsFeltArrs [][]*caigotypes.Felt, err error) { diff --git a/relayer/pkg/chainlink/ocr2/config_digester.go b/relayer/pkg/chainlink/ocr2/config_digester.go index d14a72642..f61f22c93 100644 --- a/relayer/pkg/chainlink/ocr2/config_digester.go +++ b/relayer/pkg/chainlink/ocr2/config_digester.go @@ -6,7 +6,7 @@ import ( "math/big" "strings" - "github.com/NethermindEth/juno/pkg/crypto/pedersen" + "github.com/smartcontractkit/caigo" "github.com/smartcontractkit/libocr/offchainreporting2/types" @@ -90,15 +90,22 @@ func (d offchainConfigDigester) ConfigDigest(cfg types.ContractConfig) (types.Co ) msg = append(msg, offchainConfig...) // offchain_config - digest := pedersen.ArrayDigest(msg...) + digest, err := caigo.Curve.ComputeHashOnElements(msg) + if err != nil { + return configDigest, err + } digest.FillBytes(configDigest[:]) // set first two bytes to the digest prefix - binary.BigEndian.PutUint16(configDigest[:2], uint16(d.ConfigDigestPrefix())) + pre, err := d.ConfigDigestPrefix() + if err != nil { + return configDigest, err + } + binary.BigEndian.PutUint16(configDigest[:2], uint16(pre)) return configDigest, nil } -func (offchainConfigDigester) ConfigDigestPrefix() types.ConfigDigestPrefix { - return ConfigDigestPrefixStarknet +func (offchainConfigDigester) ConfigDigestPrefix() (types.ConfigDigestPrefix, error) { + return ConfigDigestPrefixStarknet, nil } diff --git a/relayer/pkg/chainlink/ocr2/contract_reader.go b/relayer/pkg/chainlink/ocr2/contract_reader.go index 4f34b7435..3adcab9f0 100644 --- a/relayer/pkg/chainlink/ocr2/contract_reader.go +++ b/relayer/pkg/chainlink/ocr2/contract_reader.go @@ -5,8 +5,8 @@ import ( "math/big" "time" - caigotypes "github.com/smartcontractkit/caigo/types" "github.com/pkg/errors" + caigotypes "github.com/smartcontractkit/caigo/types" "github.com/smartcontractkit/chainlink-relay/pkg/logger" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" diff --git a/relayer/pkg/chainlink/ocr2/contract_transmitter.go b/relayer/pkg/chainlink/ocr2/contract_transmitter.go index 76c803041..10976cfbb 100644 --- a/relayer/pkg/chainlink/ocr2/contract_transmitter.go +++ b/relayer/pkg/chainlink/ocr2/contract_transmitter.go @@ -108,6 +108,6 @@ func (c *contractTransmitter) LatestConfigDigestAndEpoch( return } -func (c *contractTransmitter) FromAccount() types.Account { - return types.Account(c.accountAddress.String()) +func (c *contractTransmitter) FromAccount() (types.Account, error) { + return types.Account(c.accountAddress.String()), nil } diff --git a/relayer/pkg/chainlink/ocr2/medianreport/report.go b/relayer/pkg/chainlink/ocr2/medianreport/report.go index 6a7d12d30..9df7ee4b5 100644 --- a/relayer/pkg/chainlink/ocr2/medianreport/report.go +++ b/relayer/pkg/chainlink/ocr2/medianreport/report.go @@ -7,9 +7,8 @@ import ( "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet" - junotypes "github.com/NethermindEth/juno/pkg/types" - caigotypes "github.com/smartcontractkit/caigo/types" "github.com/pkg/errors" + caigotypes "github.com/smartcontractkit/caigo/types" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" "github.com/smartcontractkit/libocr/offchainreporting2/types" @@ -17,14 +16,14 @@ import ( var _ median.ReportCodec = (*ReportCodec)(nil) -const ( - timestampSizeBytes = junotypes.FeltLength - observersSizeBytes = junotypes.FeltLength - observationsLenBytes = junotypes.FeltLength +var ( + timestampSizeBytes = starknet.FeltLength + observersSizeBytes = starknet.FeltLength + observationsLenBytes = starknet.FeltLength prefixSizeBytes = timestampSizeBytes + observersSizeBytes + observationsLenBytes - juelsPerFeeCoinSizeBytes = junotypes.FeltLength - gasPriceSizeBytes = junotypes.FeltLength - observationSizeBytes = junotypes.FeltLength + juelsPerFeeCoinSizeBytes = starknet.FeltLength + gasPriceSizeBytes = starknet.FeltLength + observationSizeBytes = starknet.FeltLength ) type ReportCodec struct{} @@ -37,14 +36,14 @@ func (c ReportCodec) BuildReport(oo []median.ParsedAttributedObservation) (types // preserve original array oo = append([]median.ParsedAttributedObservation{}, oo...) - numFelt := junotypes.BigToFelt(big.NewInt(int64(num))) + numFelt := caigotypes.BigToFelt(big.NewInt(int64(num))) // median timestamp sort.Slice(oo, func(i, j int) bool { return oo[i].Timestamp < oo[j].Timestamp }) timestamp := oo[num/2].Timestamp - timestampFelt := junotypes.BigToFelt(big.NewInt(int64(timestamp))) + timestampFelt := caigotypes.BigToFelt(big.NewInt(int64(timestamp))) // median juelsPerFeeCoin sort.Slice(oo, func(i, j int) bool { @@ -52,28 +51,28 @@ func (c ReportCodec) BuildReport(oo []median.ParsedAttributedObservation) (types }) juelsPerFeeCoin := oo[num/2].JuelsPerFeeCoin juelsPerFeeCoin = starknet.SignedBigToFelt(juelsPerFeeCoin) // converts negative bigInts to corresponding felt in bigInt form - juelsPerFeeCoinFelt := junotypes.BigToFelt(juelsPerFeeCoin) + juelsPerFeeCoinFelt := caigotypes.BigToFelt(juelsPerFeeCoin) // TODO: source from observations gasPrice := big.NewInt(1) // := oo[num/2].GasPrice - gasPriceFelt := junotypes.BigToFelt(gasPrice) + gasPriceFelt := caigotypes.BigToFelt(gasPrice) // sort by values sort.Slice(oo, func(i, j int) bool { return oo[i].Value.Cmp(oo[j].Value) < 0 }) - var observers junotypes.Felt - var observations []junotypes.Felt + var observers = make([]byte, starknet.FeltLength) + var observations []*caigotypes.Felt for i, o := range oo { observers[i] = byte(o.Observer) obs := starknet.SignedBigToFelt(o.Value) // converts negative bigInts to corresponding felt in bigInt form - observations = append(observations, junotypes.BigToFelt(obs)) + observations = append(observations, caigotypes.BigToFelt(obs)) } var report []byte report = append(report, timestampFelt.Bytes()...) - report = append(report, observers.Bytes()...) + report = append(report, observers...) report = append(report, numFelt.Bytes()...) for _, o := range observations { report = append(report, o.Bytes()...) @@ -91,7 +90,7 @@ func (c ReportCodec) MedianFromReport(report types.Report) (*big.Int, error) { } // Decode the number of observations - numBig := junotypes.BytesToFelt(report[(timestampSizeBytes + observersSizeBytes):prefixSizeBytes]).Big() + numBig := caigotypes.BytesToFelt(report[(timestampSizeBytes + observersSizeBytes):prefixSizeBytes]).Big() if !numBig.IsUint64() { return nil, errors.New("length of observations is invalid") } @@ -115,9 +114,7 @@ func (c ReportCodec) MedianFromReport(report types.Report) (*big.Int, error) { for i := 0; i < n; i++ { start := prefixSizeBytes + observationSizeBytes*i end := start + observationSizeBytes - o := starknet.FeltToSignedBig(&caigotypes.Felt{ - Int: junotypes.BytesToFelt(report[start:end]).Big(), - }) + o := starknet.FeltToSignedBig(caigotypes.BytesToFelt(report[start:end])) oo = append(oo, o) } @@ -133,12 +130,12 @@ func (c ReportCodec) MedianFromReport(report types.Report) (*big.Int, error) { return oo[n/2], nil } -func (c ReportCodec) MaxReportLength(n int) int { - return prefixSizeBytes + (n * observationSizeBytes) + juelsPerFeeCoinSizeBytes + gasPriceSizeBytes +func (c ReportCodec) MaxReportLength(n int) (int, error) { + return prefixSizeBytes + (n * observationSizeBytes) + juelsPerFeeCoinSizeBytes + gasPriceSizeBytes, nil } func SplitReport(report types.Report) ([][]byte, error) { - chunkSize := junotypes.FeltLength + chunkSize := starknet.FeltLength if len(report)%chunkSize != 0 { return [][]byte{}, errors.New("invalid report length") } diff --git a/relayer/pkg/chainlink/ocr2/medianreport/report_test.go b/relayer/pkg/chainlink/ocr2/medianreport/report_test.go index 4d4eaf10e..2a94cc9d1 100644 --- a/relayer/pkg/chainlink/ocr2/medianreport/report_test.go +++ b/relayer/pkg/chainlink/ocr2/medianreport/report_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" - junotypes "github.com/NethermindEth/juno/pkg/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + caigotypes "github.com/smartcontractkit/caigo/types" "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" ) @@ -44,7 +44,7 @@ func TestBuildReport(t *testing.T) { assert.Equal(t, totalLen, len(report), "validate length") // validate timestamp - timestamp := junotypes.BytesToFelt(report[0:timestampSizeBytes]).Big() + timestamp := caigotypes.BytesToFelt(report[0:timestampSizeBytes]).Big() assert.Equal(t, uint64(oo[0].Timestamp), timestamp.Uint64(), "validate timestamp") // validate observers @@ -53,7 +53,7 @@ func TestBuildReport(t *testing.T) { // validate observer count index += observersSizeBytes - count := junotypes.BytesToFelt(report[index : index+observationsLenBytes]).Big() + count := caigotypes.BytesToFelt(report[index : index+observationsLenBytes]).Big() assert.Equal(t, uint8(n), uint8(count.Uint64()), "validate observer count") // validate observations @@ -145,7 +145,9 @@ func TestMedianFromReport(t *testing.T) { } report, err := cdc.BuildReport(pos) require.NoError(t, err) - assert.Equal(t, len(report), cdc.MaxReportLength(len(tc.obs))) + max, err := cdc.MaxReportLength(len(tc.obs)) + require.NoError(t, err) + assert.Equal(t, len(report), max) med, err := cdc.MedianFromReport(report) require.NoError(t, err) assert.Equal(t, tc.expectedMedian.String(), med.String()) diff --git a/relayer/pkg/chainlink/ocr2/mocks/OCR2Reader.go b/relayer/pkg/chainlink/ocr2/mocks/OCR2Reader.go index 438fa7f4b..4414d3306 100644 --- a/relayer/pkg/chainlink/ocr2/mocks/OCR2Reader.go +++ b/relayer/pkg/chainlink/ocr2/mocks/OCR2Reader.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks @@ -41,13 +41,16 @@ func (_m *OCR2Reader) BillingDetails(_a0 context.Context, _a1 types.Hash) (ocr2. ret := _m.Called(_a0, _a1) var r0 ocr2.BillingDetails + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Hash) (ocr2.BillingDetails, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Hash) ocr2.BillingDetails); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(ocr2.BillingDetails) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Hash) error); ok { r1 = rf(_a0, _a1) } else { @@ -62,13 +65,16 @@ func (_m *OCR2Reader) ConfigFromEventAt(_a0 context.Context, _a1 types.Hash, _a2 ret := _m.Called(_a0, _a1, _a2) var r0 ocr2.ContractConfig + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Hash, uint64) (ocr2.ContractConfig, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, types.Hash, uint64) ocr2.ContractConfig); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Get(0).(ocr2.ContractConfig) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Hash, uint64) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -83,13 +89,16 @@ func (_m *OCR2Reader) LatestConfigDetails(_a0 context.Context, _a1 types.Hash) ( ret := _m.Called(_a0, _a1) var r0 ocr2.ContractConfigDetails + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Hash) (ocr2.ContractConfigDetails, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Hash) ocr2.ContractConfigDetails); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(ocr2.ContractConfigDetails) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Hash) error); ok { r1 = rf(_a0, _a1) } else { @@ -104,13 +113,16 @@ func (_m *OCR2Reader) LatestRoundData(_a0 context.Context, _a1 types.Hash) (ocr2 ret := _m.Called(_a0, _a1) var r0 ocr2.RoundData + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Hash) (ocr2.RoundData, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Hash) ocr2.RoundData); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(ocr2.RoundData) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Hash) error); ok { r1 = rf(_a0, _a1) } else { @@ -125,13 +137,16 @@ func (_m *OCR2Reader) LatestTransmissionDetails(_a0 context.Context, _a1 types.H ret := _m.Called(_a0, _a1) var r0 ocr2.TransmissionDetails + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Hash) (ocr2.TransmissionDetails, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Hash) ocr2.TransmissionDetails); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(ocr2.TransmissionDetails) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Hash) error); ok { r1 = rf(_a0, _a1) } else { @@ -146,6 +161,10 @@ func (_m *OCR2Reader) LinkAvailableForPayment(_a0 context.Context, _a1 types.Has ret := _m.Called(_a0, _a1) var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Hash) (*big.Int, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Hash) *big.Int); ok { r0 = rf(_a0, _a1) } else { @@ -154,7 +173,6 @@ func (_m *OCR2Reader) LinkAvailableForPayment(_a0 context.Context, _a1 types.Has } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Hash) error); ok { r1 = rf(_a0, _a1) } else { @@ -169,6 +187,10 @@ func (_m *OCR2Reader) NewTransmissionsFromEventsAt(_a0 context.Context, _a1 type ret := _m.Called(_a0, _a1, _a2) var r0 []ocr2.NewTransmissionEvent + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Hash, uint64) ([]ocr2.NewTransmissionEvent, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, types.Hash, uint64) []ocr2.NewTransmissionEvent); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -177,7 +199,6 @@ func (_m *OCR2Reader) NewTransmissionsFromEventsAt(_a0 context.Context, _a1 type } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Hash, uint64) error); ok { r1 = rf(_a0, _a1, _a2) } else { diff --git a/relayer/pkg/chainlink/ocr2/types.go b/relayer/pkg/chainlink/ocr2/types.go index 316587c24..c1099766c 100644 --- a/relayer/pkg/chainlink/ocr2/types.go +++ b/relayer/pkg/chainlink/ocr2/types.go @@ -8,8 +8,7 @@ import ( "github.com/pkg/errors" - junotypes "github.com/NethermindEth/juno/pkg/types" - + caigotypes "github.com/smartcontractkit/caigo/types" "github.com/smartcontractkit/libocr/offchainreporting2/types" ) @@ -63,7 +62,7 @@ type RoundData struct { UpdatedAt time.Time } -func NewRoundData(felts []junotypes.Felt) (data RoundData, err error) { +func NewRoundData(felts []*caigotypes.Felt) (data RoundData, err error) { if len(felts) != 5 { return data, fmt.Errorf("expected number of felts to be 5 but got %d", len(felts)) } diff --git a/relayer/pkg/chainlink/ocr2/types_test.go b/relayer/pkg/chainlink/ocr2/types_test.go index 941e03735..4f3bdbf19 100644 --- a/relayer/pkg/chainlink/ocr2/types_test.go +++ b/relayer/pkg/chainlink/ocr2/types_test.go @@ -5,14 +5,14 @@ import ( "testing" "time" - junotypes "github.com/NethermindEth/juno/pkg/types" + caigotypes "github.com/smartcontractkit/caigo/types" "github.com/stretchr/testify/require" ) -func StringsToJunoFelts(in []string) []junotypes.Felt { - out := make([]junotypes.Felt, len(in)) +func StringsToCaigoFelts(in []string) []*caigotypes.Felt { + out := make([]*caigotypes.Felt, len(in)) for i := 0; i < len(in); i++ { - out[i] = junotypes.HexToFelt(in[i]) + out[i] = caigotypes.StrToFelt(in[i]) } return out } @@ -26,7 +26,7 @@ func TestNewRoundData(t *testing.T) { "0x633344a5", } - felts := StringsToJunoFelts(raw) + felts := StringsToCaigoFelts(raw) actualRound, err := NewRoundData(felts) require.NoError(t, err) expectedRound := RoundData{ diff --git a/relayer/pkg/chainlink/ocr2/utils.go b/relayer/pkg/chainlink/ocr2/utils.go index f695f7913..1a72d5c98 100644 --- a/relayer/pkg/chainlink/ocr2/utils.go +++ b/relayer/pkg/chainlink/ocr2/utils.go @@ -4,15 +4,15 @@ import ( "encoding/binary" "math/big" - junotypes "github.com/NethermindEth/juno/pkg/types" + "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet" "github.com/smartcontractkit/libocr/offchainreporting2/types" ) func parseEpochAndRound(felt *big.Int) (epoch uint32, round uint8) { - var epochAndRound [junotypes.FeltLength]byte + var epochAndRound [starknet.FeltLength]byte felt.FillBytes(epochAndRound[:]) - epoch = binary.BigEndian.Uint32(epochAndRound[junotypes.FeltLength-5 : junotypes.FeltLength-1]) - round = epochAndRound[junotypes.FeltLength-1] + epoch = binary.BigEndian.Uint32(epochAndRound[starknet.FeltLength-5 : starknet.FeltLength-1]) + round = epochAndRound[starknet.FeltLength-1] return epoch, round } diff --git a/relayer/pkg/chainlink/txm/config.go b/relayer/pkg/chainlink/txm/config.go index 925386b4b..6198b1270 100644 --- a/relayer/pkg/chainlink/txm/config.go +++ b/relayer/pkg/chainlink/txm/config.go @@ -6,7 +6,6 @@ import "time" // txm config type Config interface { + ConfirmationPoll() time.Duration TxTimeout() time.Duration - TxSendFrequency() time.Duration - TxMaxBatchSize() int } diff --git a/relayer/pkg/chainlink/txm/keystore.go b/relayer/pkg/chainlink/txm/keystore.go new file mode 100644 index 000000000..6881ac77d --- /dev/null +++ b/relayer/pkg/chainlink/txm/keystore.go @@ -0,0 +1,54 @@ +package txm + +import ( + "context" + "errors" + "fmt" + "math/big" + + "github.com/smartcontractkit/caigo" + + "github.com/smartcontractkit/chainlink-relay/pkg/loop" + adapters "github.com/smartcontractkit/chainlink-relay/pkg/loop/adapters/starknet" +) + +// KeystoreAdapter is a starknet-specific adaption layer to translate between the generic Loop Keystore (bytes) and +// the type specific caigo Keystore (big.Int) +type KeystoreAdapter interface { + caigo.Keystore + Loopp() loop.Keystore +} + +// keystoreAdapter implements [KeystoreAdapter]. +type keystoreAdapter struct { + looppKs loop.Keystore +} + +// NewKeystoreAdapter instantiates the KeystoreAdapter interface +// The implementation requires that the given [looppKs] produces a signature [loop.Keystore.Sign] +// that is []byte representation of [adapters.Signature] +// Callers are responsible for ensuring that the given LOOPp Keystore encodes +// signatures correctly. +func NewKeystoreAdapter(lk loop.Keystore) KeystoreAdapter { + return &keystoreAdapter{looppKs: lk} +} + +var ErrBadAdapterEncoding = errors.New("failed to decode raw signature as adapter signature") + +// Sign implements the caigo Keystore Sign func. Returns [ErrBadAdapterSignature] if the signature cannot be +// decoded from the [loop.Keystore] implementation +func (ca *keystoreAdapter) Sign(ctx context.Context, senderAddress string, hash *big.Int) (*big.Int, *big.Int, error) { + raw, err := ca.looppKs.Sign(ctx, senderAddress, hash.Bytes()) + if err != nil { + return nil, nil, fmt.Errorf("error computing loopp keystore signature: %w", err) + } + starknetSig, serr := adapters.SignatureFromBytes(raw) + if serr != nil { + return nil, nil, fmt.Errorf("%w: %w", ErrBadAdapterEncoding, serr) + } + return starknetSig.Ints() +} + +func (ca *keystoreAdapter) Loopp() loop.Keystore { + return ca.looppKs +} diff --git a/relayer/pkg/chainlink/txm/keystore_test.go b/relayer/pkg/chainlink/txm/keystore_test.go new file mode 100644 index 000000000..f68353380 --- /dev/null +++ b/relayer/pkg/chainlink/txm/keystore_test.go @@ -0,0 +1,51 @@ +package txm_test + +import ( + "context" + "math/big" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-relay/pkg/loop" + adapters "github.com/smartcontractkit/chainlink-relay/pkg/loop/adapters/starknet" + "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/txm" +) + +func TestKeystoreAdapterImpl(t *testing.T) { + t.Run("valid loop keystore impl", func(t *testing.T) { + goodLoopSignFn := func(ctx context.Context, account string, data []byte) (signed []byte, err error) { + sig, err := adapters.SignatureFromBigInts(big.NewInt(7), big.NewInt(11)) + require.NoError(t, err) + return sig.Bytes() + } + ksa := txm.NewKeystoreAdapter(&testLoopKeystore{signFn: goodLoopSignFn}) + + _, _, err := ksa.Sign(context.Background(), "anything", big.NewInt(42)) + require.NoError(t, err) + }) + t.Run("invalid loop keystore impl", func(t *testing.T) { + badLoopSignFn := func(ctx context.Context, account string, data []byte) (signed []byte, err error) { + return []byte("not an adapter signature"), nil + } + ksa := txm.NewKeystoreAdapter(&testLoopKeystore{signFn: badLoopSignFn}) + + _, _, err := ksa.Sign(context.Background(), "anything", big.NewInt(42)) + require.ErrorIs(t, err, txm.ErrBadAdapterEncoding) + }) + +} + +type testLoopKeystore struct { + signFn func(ctx context.Context, account string, data []byte) (signed []byte, err error) +} + +var _ loop.Keystore = &testLoopKeystore{} + +func (lk *testLoopKeystore) Sign(ctx context.Context, account string, data []byte) (signed []byte, err error) { + return lk.signFn(ctx, account, data) +} + +func (lk *testLoopKeystore) Accounts(ctx context.Context) (accounts []string, err error) { + return nil, nil +} diff --git a/relayer/pkg/chainlink/txm/mocks/config.go b/relayer/pkg/chainlink/txm/mocks/config.go index 497bf9b32..71c812269 100644 --- a/relayer/pkg/chainlink/txm/mocks/config.go +++ b/relayer/pkg/chainlink/txm/mocks/config.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.13.0-beta.1. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks @@ -13,22 +13,8 @@ type Config struct { mock.Mock } -// TxMaxBatchSize provides a mock function with given fields: -func (_m *Config) TxMaxBatchSize() int { - ret := _m.Called() - - var r0 int - if rf, ok := ret.Get(0).(func() int); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int) - } - - return r0 -} - -// TxSendFrequency provides a mock function with given fields: -func (_m *Config) TxSendFrequency() time.Duration { +// ConfirmationPoll provides a mock function with given fields: +func (_m *Config) ConfirmationPoll() time.Duration { ret := _m.Called() var r0 time.Duration @@ -55,13 +41,13 @@ func (_m *Config) TxTimeout() time.Duration { return r0 } -type NewConfigT interface { +type mockConstructorTestingTNewConfig interface { mock.TestingT Cleanup(func()) } // NewConfig creates a new instance of Config. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewConfig(t NewConfigT) *Config { +func NewConfig(t mockConstructorTestingTNewConfig) *Config { mock := &Config{} mock.Mock.Test(t) diff --git a/relayer/pkg/chainlink/txm/mocks/nonce_manager_client.go b/relayer/pkg/chainlink/txm/mocks/nonce_manager_client.go new file mode 100644 index 000000000..e49c10388 --- /dev/null +++ b/relayer/pkg/chainlink/txm/mocks/nonce_manager_client.go @@ -0,0 +1,58 @@ +// Code generated by mockery v2.28.1. DO NOT EDIT. + +package mocks + +import ( + context "context" + big "math/big" + + mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/caigo/types" +) + +// NonceManagerClient is an autogenerated mock type for the NonceManagerClient type +type NonceManagerClient struct { + mock.Mock +} + +// AccountNonce provides a mock function with given fields: _a0, _a1 +func (_m *NonceManagerClient) AccountNonce(_a0 context.Context, _a1 types.Hash) (*big.Int, error) { + ret := _m.Called(_a0, _a1) + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Hash) (*big.Int, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, types.Hash) *big.Int); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, types.Hash) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +type mockConstructorTestingTNewNonceManagerClient interface { + mock.TestingT + Cleanup(func()) +} + +// NewNonceManagerClient creates a new instance of NonceManagerClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewNonceManagerClient(t mockConstructorTestingTNewNonceManagerClient) *NonceManagerClient { + mock := &NonceManagerClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/relayer/pkg/chainlink/txm/nonce.go b/relayer/pkg/chainlink/txm/nonce.go new file mode 100644 index 000000000..cac095dbd --- /dev/null +++ b/relayer/pkg/chainlink/txm/nonce.go @@ -0,0 +1,123 @@ +package txm + +import ( + "context" + "fmt" + "math/big" + "sync" + + caigotypes "github.com/smartcontractkit/caigo/types" + + "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-relay/pkg/utils" +) + +//go:generate mockery --name NonceManagerClient --output ./mocks/ --case=underscore --filename nonce_manager_client.go + +type NonceManagerClient interface { + AccountNonce(context.Context, caigotypes.Hash) (*big.Int, error) +} + +type NonceManager interface { + types.Service + + Register(ctx context.Context, address caigotypes.Hash, chainId string, client NonceManagerClient) error + + NextSequence(address caigotypes.Hash, chainID string) (*big.Int, error) + IncrementNextSequence(address caigotypes.Hash, chainID string, currentNonce *big.Int) error +} + +var _ NonceManager = (*nonceManager)(nil) + +type nonceManager struct { + starter utils.StartStopOnce + lggr logger.Logger + + n map[string]map[string]*big.Int // map address + chain ID to nonce + lock sync.RWMutex +} + +func NewNonceManager(lggr logger.Logger) *nonceManager { + return &nonceManager{ + lggr: logger.Named(lggr, "NonceManager"), + n: map[string]map[string]*big.Int{}, + } +} + +func (nm *nonceManager) Start(ctx context.Context) error { + return nm.starter.StartOnce(nm.Name(), func() error { return nil }) +} + +func (nm *nonceManager) Ready() error { + return nm.starter.Ready() +} + +func (nm *nonceManager) Name() string { + return nm.lggr.Name() +} + +func (nm *nonceManager) Close() error { + return nm.starter.StopOnce(nm.Name(), func() error { return nil }) +} + +func (nm *nonceManager) HealthReport() map[string]error { + return map[string]error{nm.Name(): nm.starter.Healthy()} +} + +// Register is used because we cannot pre-fetch nonces. the pubkey is known before hand, but the account address is not known until a job is started and sends a tx +func (nm *nonceManager) Register(ctx context.Context, addr caigotypes.Hash, chainId string, client NonceManagerClient) error { + nm.lock.Lock() + defer nm.lock.Unlock() + addressNonces, exists := nm.n[addr.String()] + if !exists { + nm.n[addr.String()] = map[string]*big.Int{} + } + _, exists = addressNonces[chainId] + if !exists { + n, err := client.AccountNonce(ctx, addr) + if err != nil { + return err + } + nm.n[addr.String()][chainId] = n + } + + return nil +} + +func (nm *nonceManager) NextSequence(addr caigotypes.Hash, chainId string) (*big.Int, error) { + if err := nm.validate(addr, chainId); err != nil { + return nil, err + } + + nm.lock.RLock() + defer nm.lock.RUnlock() + return nm.n[addr.String()][chainId], nil +} + +func (nm *nonceManager) IncrementNextSequence(addr caigotypes.Hash, chainId string, currentNonce *big.Int) error { + if err := nm.validate(addr, chainId); err != nil { + return err + } + + nm.lock.Lock() + defer nm.lock.Unlock() + n := nm.n[addr.String()][chainId] + if n.Cmp(currentNonce) != 0 { + return fmt.Errorf("mismatched nonce for %s: %s (expected) != %s (got)", addr, n, currentNonce) + } + nm.n[addr.String()][chainId] = big.NewInt(n.Int64() + 1) + return nil +} + +func (nm *nonceManager) validate(addr caigotypes.Hash, id string) error { + nm.lock.RLock() + defer nm.lock.RUnlock() + if _, exists := nm.n[addr.String()]; !exists { + return fmt.Errorf("nonce tracking does not exist for key: %s", addr.String()) + } + if _, exists := nm.n[addr.String()][id]; !exists { + return fmt.Errorf("nonce does not exist for key: %s and chain: %s", addr.String(), id) + } + return nil +} diff --git a/relayer/pkg/chainlink/txm/nonce_test.go b/relayer/pkg/chainlink/txm/nonce_test.go new file mode 100644 index 000000000..124719434 --- /dev/null +++ b/relayer/pkg/chainlink/txm/nonce_test.go @@ -0,0 +1,100 @@ +package txm_test + +import ( + "fmt" + "math/big" + "testing" + + caigotypes "github.com/smartcontractkit/caigo/types" + + "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/txm" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/txm/mocks" +) + +func newTestNonceManager(t *testing.T, chainID string, initNonce *big.Int) (txm.NonceManager, caigotypes.Hash, func()) { + // setup + c := mocks.NewNonceManagerClient(t) + lggr := logger.Test(t) + nm := txm.NewNonceManager(lggr) + + // mock returns + keyHash := caigotypes.HexToHash("test-key-id") + c.On("AccountNonce", mock.Anything, mock.Anything).Return(initNonce, nil).Once() + + require.NoError(t, nm.Start(utils.Context(t))) + require.NoError(t, nm.Register(utils.Context(t), keyHash, chainID, c)) + + return nm, keyHash, func() { require.NoError(t, nm.Close()) } +} + +func TestNonceManager_NextSequence(t *testing.T) { + t.Parallel() + + chainId := "test_nextSequence" + initNonce := big.NewInt(10) + nm, k, stop := newTestNonceManager(t, chainId, initNonce) + defer stop() + + // get with proper inputs + nonce, err := nm.NextSequence(k, chainId) + require.NoError(t, err) + assert.Equal(t, initNonce, nonce) + + // should fail with invalid chain id + _, err = nm.NextSequence(k, "invalid_chainId") + require.Error(t, err) + assert.Contains(t, err.Error(), fmt.Sprintf("nonce does not exist for key: %s and chain: %s", k.String(), "invalid_chainId")) + + // should fail with invalid address + randAddr1 := caigotypes.Hash{1} + _, err = nm.NextSequence(randAddr1, chainId) + require.Error(t, err) + assert.Contains(t, err.Error(), fmt.Sprintf("nonce tracking does not exist for key: %s", randAddr1.String())) +} + +func TestNonceManager_IncrementNextSequence(t *testing.T) { + t.Parallel() + + chainId := "test_nextSequence" + initNonce := big.NewInt(10) + nm, k, stop := newTestNonceManager(t, chainId, initNonce) + defer stop() + + initMinusOne := big.NewInt(initNonce.Int64() - 1) + initPlusOne := big.NewInt(initNonce.Int64() + 1) + + // should fail if nonce is lower then expected + err := nm.IncrementNextSequence(k, chainId, initMinusOne) + require.Error(t, err) + assert.Contains(t, err.Error(), fmt.Sprintf("mismatched nonce for %s: %s (expected) != %s (got)", k, initNonce, initMinusOne)) + + // increment with proper inputs + err = nm.IncrementNextSequence(k, chainId, initNonce) + require.NoError(t, err) + next, err := nm.NextSequence(k, chainId) + require.NoError(t, err) + assert.Equal(t, initPlusOne, next) + + // should fail with invalid chain id + err = nm.IncrementNextSequence(k, "invalid_chainId", initPlusOne) + require.Error(t, err) + assert.Contains(t, err.Error(), fmt.Sprintf("nonce does not exist for key: %s and chain: %s", k.String(), "invalid_chainId")) + + // should fail with invalid address + randAddr1 := caigotypes.Hash{1} + err = nm.IncrementNextSequence(randAddr1, chainId, initPlusOne) + require.Error(t, err) + assert.Contains(t, err.Error(), fmt.Sprintf("nonce tracking does not exist for key: %s", randAddr1.String())) + + // verify it didnt get changed by any erroring calls + next, err = nm.NextSequence(k, chainId) + require.NoError(t, err) + assert.Equal(t, initPlusOne, next) +} diff --git a/relayer/pkg/chainlink/txm/test_helpers.go b/relayer/pkg/chainlink/txm/test_helpers.go index 927f6345b..661dcf1d8 100644 --- a/relayer/pkg/chainlink/txm/test_helpers.go +++ b/relayer/pkg/chainlink/txm/test_helpers.go @@ -2,7 +2,6 @@ package txm import ( "bytes" - "math/big" "net/http" "os/exec" "testing" @@ -29,11 +28,6 @@ var ( "0xb4862b21fb97d43588561712e8e5216a", "0x259f4329e6f4590b9a164106cf6a659e", } - - // devnet key derivation - // https://github.com/Shard-Labs/starknet-devnet/blob/master/starknet_devnet/account.py - DevnetClassHash, _ = new(big.Int).SetString("1803505466663265559571280894381905521939782500874858933595227108099796801620", 10) - DevnetSalt = big.NewInt(20) ) // SetupLocalStarknetNode sets up a local starknet node via cli, and returns the url diff --git a/relayer/pkg/chainlink/txm/txm.go b/relayer/pkg/chainlink/txm/txm.go index ebdcc085f..572971baf 100644 --- a/relayer/pkg/chainlink/txm/txm.go +++ b/relayer/pkg/chainlink/txm/txm.go @@ -2,21 +2,22 @@ package txm import ( "context" + "errors" + "fmt" "math/big" "sync" "time" - "github.com/pkg/errors" "github.com/smartcontractkit/caigo" + "github.com/smartcontractkit/caigo/gateway" caigotypes "github.com/smartcontractkit/caigo/types" + "golang.org/x/exp/maps" "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-relay/pkg/loop" relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" "github.com/smartcontractkit/chainlink-relay/pkg/utils" - "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet" - - "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/keys" ) const ( @@ -24,7 +25,8 @@ const ( ) type TxManager interface { - Enqueue(caigotypes.Hash, caigotypes.Hash, caigotypes.FunctionCall) error + Enqueue(senderAddress caigotypes.Hash, accountAddress caigotypes.Hash, txFn caigotypes.FunctionCall) error + InflightCount() (int, int) } type Tx struct { @@ -44,23 +46,27 @@ type starktxm struct { done sync.WaitGroup stop chan struct{} queue chan Tx - ks keys.Keystore + ks KeystoreAdapter cfg Config + nonce NonceManager - // TODO: use lazy loaded client - client *starknet.Client - getClient func() (*starknet.Client, error) + client *utils.LazyLoad[*starknet.Client] + txStore *ChainTxStore } -func New(lggr logger.Logger, keystore keys.Keystore, cfg Config, getClient func() (*starknet.Client, error)) (StarkTXM, error) { - return &starktxm{ - lggr: logger.Named(lggr, "StarknetTxm"), - queue: make(chan Tx, MaxQueueLen), - stop: make(chan struct{}), - getClient: getClient, - ks: keystore, - cfg: cfg, - }, nil +func New(lggr logger.Logger, keystore loop.Keystore, cfg Config, getClient func() (*starknet.Client, error)) (StarkTXM, error) { + txm := &starktxm{ + lggr: logger.Named(lggr, "StarknetTxm"), + queue: make(chan Tx, MaxQueueLen), + stop: make(chan struct{}), + client: utils.NewLazyLoad(getClient), + ks: NewKeystoreAdapter(keystore), + cfg: cfg, + txStore: NewChainTxStore(), + } + txm.nonce = NewNonceManager(txm.lggr) + + return txm, nil } func (txm *starktxm) Name() string { @@ -69,111 +75,79 @@ func (txm *starktxm) Name() string { func (txm *starktxm) Start(ctx context.Context) error { return txm.starter.StartOnce("starktxm", func() error { - txm.done.Add(1) // waitgroup: tx sender - go txm.run() + if err := txm.nonce.Start(ctx); err != nil { + return err + } + + txm.done.Add(2) // waitgroup: tx sender + confirmer + go txm.broadcastLoop() + go txm.confirmLoop() return nil }) } -func (txm *starktxm) run() { +func (txm *starktxm) broadcastLoop() { defer txm.done.Done() - // TODO: func not available without importing core - // ctx, cancel := utils.ContextFromChan(txm.stop) - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := utils.ContextFromChan(txm.stop) defer cancel() - tick := time.After(0) - + txm.lggr.Debugw("broadcastLoop: started") for { select { - case <-tick: - start := time.Now() - - // fetch client if needed (before processing txs to preserve queue) - if txm.client == nil { - var err error - txm.client, err = txm.getClient() - if err != nil { - txm.lggr.Errorw("unable to fetch client", "error", err) - tick = time.After(utils.WithJitter(txm.cfg.TxSendFrequency()) - time.Since(start)) // reset tick - txm.client = nil // reset - continue - } - } - - // calculate total txs to process - txLen := len(txm.queue) - if txLen > txm.cfg.TxMaxBatchSize() { - txLen = txm.cfg.TxMaxBatchSize() + case <-txm.stop: + txm.lggr.Debugw("broadcastLoop: stopped") + return + default: + // skip processing if queue is empty + if len(txm.queue) == 0 { + continue } - type senderAccountPair struct { - senderAddress caigotypes.Hash - accountAddress caigotypes.Hash + // preserve tx queue: don't pull tx from queue until client is known to work + if _, err := txm.client.Get(); err != nil { + txm.lggr.Errorw("failed to fetch client: skipping processing tx", "error", err) + continue } - - // split the transactions by sender and account address for batching. - // this avoids assuming that there is always a 1:1 mapping from sender addresses - // onto account addresses. - txsByAccount := map[senderAccountPair][]caigotypes.FunctionCall{} - for i := 0; i < txLen; i++ { - tx := <-txm.queue - key := senderAccountPair{ - senderAddress: tx.senderAddress, - accountAddress: tx.accountAddress, - } - txsByAccount[key] = append(txsByAccount[key], tx.call) + tx := <-txm.queue + + // broadcast tx serially - wait until accepted by mempool before processing next + hash, err := txm.broadcast(ctx, tx.senderAddress, tx.accountAddress, tx.call) + if err != nil { + txm.lggr.Errorw("transaction failed to broadcast", "error", err, "tx", tx.call) + } else { + txm.lggr.Infow("transaction broadcast", "txhash", hash) } - txm.lggr.Infow("creating batch", "totalTxCount", txLen, "batchCount", len(txsByAccount)) - - // async process of tx batches - var wg sync.WaitGroup - wg.Add(len(txsByAccount)) - for key, txs := range txsByAccount { - txm.lggr.Debugw("batch details", "accountAddress", key.accountAddress, "senderAddress", key.senderAddress, "txs", txs) - go func(senderAddress caigotypes.Hash, accountAddress caigotypes.Hash, txs []caigotypes.FunctionCall) { - // fetch key matching sender address - key, err := txm.ks.Get(senderAddress.String()) - if err != nil { - txm.lggr.Errorw("failed to retrieve key", "id", senderAddress, "error", err) - } else { - // parse key to expected format - privKeyBytes := key.Raw() - privKey := caigotypes.BigToHex(caigotypes.BytesToBig(privKeyBytes)) - - // broadcast batch based on account address - hash, err := txm.broadcastBatch(ctx, privKey, accountAddress, txs) - if err != nil { - txm.lggr.Errorw("transaction failed to broadcast", "error", err, "account", accountAddress, "batchTx", txs) - } else { - txm.lggr.Infow("transaction broadcast", "txhash", hash) - } - } - wg.Done() - }(key.senderAddress, key.accountAddress, txs) - } - wg.Wait() - tick = time.After(utils.WithJitter(txm.cfg.TxSendFrequency()) - time.Since(start)) - case <-txm.stop: - return } } } const FEE_MARGIN uint64 = 115 -func (txm *starktxm) broadcastBatch(ctx context.Context, privKey string, accountAddress caigotypes.Hash, txs []caigotypes.FunctionCall) (txhash string, err error) { +func (txm *starktxm) broadcast(ctx context.Context, senderAddress caigotypes.Hash, accountAddress caigotypes.Hash, tx caigotypes.FunctionCall) (txhash string, err error) { + txs := []caigotypes.FunctionCall{tx} + client, err := txm.client.Get() + if err != nil { + txm.client.Reset() + return txhash, fmt.Errorf("broadcast: failed to fetch client: %+w", err) + } // create new account - account, err := caigo.NewGatewayAccount(privKey, accountAddress.String(), txm.client.Gw, caigo.AccountVersion1) + account, err := caigo.NewGatewayAccount(senderAddress.String(), accountAddress.String(), txm.ks, client.Gw, caigo.AccountVersion1) if err != nil { - return txhash, errors.Errorf("failed to create new account: %s", err) + return txhash, fmt.Errorf("failed to create new account: %+w", err) + } + + nonce, err := txm.nonce.NextSequence(accountAddress, client.Gw.ChainId) + if err != nil { + return txhash, fmt.Errorf("failed to get nonce: %+w", err) } // get fee for txm + // optional - pass nonce to fee estimate (if nonce gets ahead, estimate may fail) + // can we estimate fee without calling estimate - tbd with 1.0 feeEstimate, err := account.EstimateFee(ctx, txs, caigotypes.ExecuteDetails{}) if err != nil { - return txhash, errors.Errorf("failed to estimate fee: %s", err) + return txhash, fmt.Errorf("failed to estimate fee: %+w", err) } fee, _ := big.NewInt(0).SetString(string(feeEstimate.OverallFee), 0) @@ -181,15 +155,16 @@ func (txm *starktxm) broadcastBatch(ctx context.Context, privKey string, account max := big.NewInt(0).Div(expandedFee, big.NewInt(100)) details := caigotypes.ExecuteDetails{ MaxFee: max, + Nonce: nonce, } - // TODO: investigate if nonce management is needed (nonce is requested queried by the sdk for now) // transmit txs - execCtx, execCancel := context.WithTimeout(ctx, txm.cfg.TxTimeout()*time.Second) + execCtx, execCancel := context.WithTimeout(ctx, txm.cfg.TxTimeout()) defer execCancel() res, err := account.Execute(execCtx, txs, details) if err != nil { - return txhash, errors.Errorf("failed to invoke tx: %s", err) + // TODO: handle initial broadcast errors - what kind of errors occur? + return txhash, fmt.Errorf("failed to invoke tx: %+w", err) } // handle nil pointer @@ -197,7 +172,66 @@ func (txm *starktxm) broadcastBatch(ctx context.Context, privKey string, account return txhash, errors.New("execute response and error are nil") } - return res.TransactionHash, nil + // update nonce if transaction is successful + err = errors.Join( + txm.nonce.IncrementNextSequence(accountAddress, client.Gw.ChainId, nonce), + txm.txStore.Save(accountAddress, nonce, res.TransactionHash), + ) + return res.TransactionHash, err +} + +func (txm *starktxm) confirmLoop() { + defer txm.done.Done() + + ctx, cancel := utils.ContextFromChan(txm.stop) + defer cancel() + + tick := time.After(txm.cfg.ConfirmationPoll()) + + txm.lggr.Debugw("confirmLoop: started") + for { + var start time.Time + select { + case <-tick: + start = time.Now() + client, err := txm.client.Get() + if err != nil { + txm.lggr.Errorw("failed to load client", "error", err) + break + } + + hashes := txm.txStore.GetAllUnconfirmed() + for addr := range hashes { + for i := range hashes[addr] { + hash := hashes[addr][i] + status, err := client.Gw.TransactionStatus(ctx, gateway.TransactionStatusOptions{ + TransactionHash: hashes[addr][i], + }) + if err != nil { + txm.lggr.Errorw("failed to fetch transaction status", "hash", hash, "error", err) + continue + } + + if status == nil { + txm.lggr.Errorw("status was nil", "hash", hash) + continue + } + + if status.TxStatus == "ACCEPTED_ON_L1" || status.TxStatus == "ACCEPTED_ON_L2" || status.TxStatus == "REJECTED" { + txm.lggr.Debugw(fmt.Sprintf("tx confirmed: %s", status.TxStatus), "hash", hash, "status", status) + if err := txm.txStore.Confirm(addr, hash); err != nil { + txm.lggr.Errorw("failed to confirm tx in TxStore", "hash", hash, "sender", addr, "error", err) + } + } + } + } + case <-txm.stop: + txm.lggr.Debugw("confirmLoop: stopped") + return + } + t := txm.cfg.ConfirmationPoll() - time.Since(start) + tick = time.After(utils.WithJitter(t.Abs())) + } } func (txm *starktxm) Close() error { @@ -220,12 +254,39 @@ func (txm *starktxm) HealthReport() map[string]error { return map[string]error{txm.Name(): txm.Healthy()} } -func (txm *starktxm) Enqueue(senderAddress caigotypes.Hash, accountAddress caigotypes.Hash, tx caigotypes.FunctionCall) error { +func (txm *starktxm) Enqueue(senderAddress, accountAddress caigotypes.Hash, tx caigotypes.FunctionCall) error { + // validate key exists for sender + // use the embedded Loopp Keystore to do this; the spec and design + // encourage passing nil data to the loop.Keystore.Sign as way to test + // existence of a key + if _, err := txm.ks.Loopp().Sign(context.Background(), senderAddress.String(), nil); err != nil { + return err + } + + client, err := txm.client.Get() + if err != nil { + txm.client.Reset() + return fmt.Errorf("broadcast: failed to fetch client: %+w", err) + } + + // register account for nonce manager + if err := txm.nonce.Register(context.TODO(), accountAddress, client.Gw.ChainId, client); err != nil { + return err + } + select { case txm.queue <- Tx{senderAddress: senderAddress, accountAddress: accountAddress, call: tx}: default: - return errors.Errorf("failed to enqueue transaction: %+v", tx) + return fmt.Errorf("failed to enqueue transaction: %+v", tx) } return nil } + +func (txm *starktxm) InflightCount() (queue int, unconfirmed int) { + list := maps.Values(txm.txStore.GetAllInflightCount()) + for _, count := range list { + unconfirmed += count + } + return len(txm.queue), unconfirmed +} diff --git a/relayer/pkg/chainlink/txm/txm_test.go b/relayer/pkg/chainlink/txm/txm_test.go index 35dc6dd33..c4f26317e 100644 --- a/relayer/pkg/chainlink/txm/txm_test.go +++ b/relayer/pkg/chainlink/txm/txm_test.go @@ -4,83 +4,68 @@ package txm import ( "context" - "encoding/hex" - "sync" + "fmt" + "math/big" "testing" "time" + "github.com/smartcontractkit/caigo" + caigogw "github.com/smartcontractkit/caigo/gateway" + "github.com/smartcontractkit/caigo/test" caigotypes "github.com/smartcontractkit/caigo/types" - "github.com/pkg/errors" - "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink-relay/pkg/logger" - - "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/keys" - "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/keys/mocks" - txmmock "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/txm/mocks" + "github.com/smartcontractkit/chainlink-relay/pkg/loop" + adapters "github.com/smartcontractkit/chainlink-relay/pkg/loop/adapters/starknet" + "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/txm/mocks" "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet" ) func TestIntegration_Txm(t *testing.T) { + n := 2 // number of txs per key url := SetupLocalStarknetNode(t) - rawLocalKeys := TestKeys(t, 2) // generate 2 keys + devnet := test.NewDevNet(url) + accounts, err := devnet.Accounts() + require.NoError(t, err) // parse keys into expected format - localKeys := map[string]keys.Key{} - for _, k := range rawLocalKeys { - key := keys.Raw(k).Key() - account := "0x" + hex.EncodeToString(keys.PubKeyToAccount(key.PublicKey(), DevnetClassHash, DevnetSalt)) - localKeys[account] = key + localKeys := map[string]*big.Int{} + localAccounts := map[string]string{} + for i := range accounts { + privKey, err := caigotypes.HexToBytes(accounts[i].PrivateKey) + require.NoError(t, err) + senderAddress := caigotypes.HexToHash(accounts[i].PublicKey).String() + localKeys[senderAddress] = caigotypes.BytesToBig(privKey) + localAccounts[senderAddress] = accounts[i].Address } // mock keystore - ks := new(mocks.Keystore) - ks.On("Get", mock.AnythingOfType("string")).Return( - func(id string) keys.Key { - return localKeys[id] - }, - func(id string) error { - - _, ok := localKeys[id] - if !ok { - return errors.New("key does not exist") - } - return nil - }, - ) - - lggr, err := logger.New() - require.NoError(t, err) + looppKs := NewLooppKeystore(func(id string) (*big.Int, error) { + _, ok := localKeys[id] + if !ok { + return nil, fmt.Errorf("key does not exist id=%s", id) + } + return localKeys[id], nil + }) + ksAdapter := NewKeystoreAdapter(looppKs) + lggr, observer := logger.TestObserved(t, zapcore.DebugLevel) timeout := 10 * time.Second - client, err := starknet.NewClient("devnet", url, lggr, &timeout) + client, err := starknet.NewClient(caigogw.GOERLI_ID, url, lggr, &timeout) require.NoError(t, err) - // test fail first client - failed := false - var wg sync.WaitGroup - wg.Add(2) - - // should be called twice getClient := func() (*starknet.Client, error) { - wg.Done() - if !failed { - failed = true - - // test return not nil - return &starknet.Client{}, errors.New("random test error") - } - - return client, nil + return client, err } // mock config to prevent import cycle - cfg := new(txmmock.Config) - cfg.On("TxMaxBatchSize").Return(100) - cfg.On("TxSendFrequency").Return(15 * time.Second) - cfg.On("TxTimeout").Return(10 * time.Second) + cfg := mocks.NewConfig(t) + cfg.On("TxTimeout").Return(20 * time.Second) + cfg.On("ConfirmationPoll").Return(1 * time.Second) - txm, err := New(lggr, ks, cfg, getClient) + txm, err := New(lggr, ksAdapter.Loopp(), cfg, getClient) require.NoError(t, err) // ready fail if start not called @@ -90,19 +75,79 @@ func TestIntegration_Txm(t *testing.T) { require.NoError(t, txm.Start(context.Background())) require.NoError(t, txm.Ready()) - for k := range localKeys { - key := caigotypes.HexToHash(k) - for i := 0; i < 5; i++ { - require.NoError(t, txm.Enqueue(key, key, caigotypes.FunctionCall{ - ContractAddress: key, // send to self - EntryPointSelector: "get_nonce", + for senderAddressStr := range localKeys { + senderAddress := caigotypes.HexToHash(senderAddressStr) + for i := 0; i < n; i++ { + require.NoError(t, txm.Enqueue(senderAddress, caigotypes.HexToHash(localAccounts[senderAddressStr]), caigotypes.FunctionCall{ + ContractAddress: caigotypes.HexToHash("0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"), // send to ETH token contract + EntryPointSelector: "totalSupply", })) } } - time.Sleep(30 * time.Second) - wg.Wait() + var empty bool + for i := 0; i < 60; i++ { + time.Sleep(500 * time.Millisecond) + queued, unconfirmed := txm.InflightCount() + accepted := len(observer.FilterMessageSnippet("ACCEPTED_ON_L2").All()) + t.Logf("inflight count: queued (%d), unconfirmed (%d), accepted (%d)", queued, unconfirmed, accepted) + + // check queue + tx store counts are 0, accepted txs == total txs broadcast + if queued == 0 && unconfirmed == 0 && n*len(localKeys) == accepted { + empty = true + break + } + } // stop txm + assert.True(t, empty, "txm timed out while trying to confirm transactions") require.NoError(t, txm.Close()) require.Error(t, txm.Ready()) + assert.Equal(t, 0, observer.FilterLevelExact(zapcore.ErrorLevel).Len()) // assert no error logs + assert.Equal(t, n*len(localKeys), len(observer.FilterMessageSnippet("ACCEPTED_ON_L2").All())) // validate txs were successfully included on chain +} + +// LooppKeystore implements [loop.Keystore] interface and the requirements +// of signature d/encoding of the [KeystoreAdapter] +type LooppKeystore struct { + Get func(id string) (*big.Int, error) +} + +func NewLooppKeystore(get func(id string) (*big.Int, error)) *LooppKeystore { + return &LooppKeystore{ + Get: get, + } +} + +var _ loop.Keystore = &LooppKeystore{} + +// Sign implements [loop.Keystore] +// hash is expected to be the byte representation of big.Int +// the return []byte is encodes a starknet signature per [signature.bytes] +func (lk *LooppKeystore) Sign(ctx context.Context, id string, hash []byte) ([]byte, error) { + + k, err := lk.Get(id) + if err != nil { + return nil, err + } + // loopp spec requires passing nil hash to check existence of id + if hash == nil { + return nil, nil + } + + starkHash := new(big.Int).SetBytes(hash) + x, y, err := caigo.Curve.Sign(starkHash, k) + if err != nil { + return nil, fmt.Errorf("error signing data with curve: %w", err) + } + + sig, err := adapters.SignatureFromBigInts(x, y) + if err != nil { + return nil, err + } + return sig.Bytes() +} + +// TODO what is this supposed to return for starknet? +func (lk *LooppKeystore) Accounts(ctx context.Context) ([]string, error) { + return nil, fmt.Errorf("unimplemented") } diff --git a/relayer/pkg/chainlink/txm/txstore.go b/relayer/pkg/chainlink/txm/txstore.go new file mode 100644 index 000000000..875c2a2d9 --- /dev/null +++ b/relayer/pkg/chainlink/txm/txstore.go @@ -0,0 +1,144 @@ +package txm + +import ( + "fmt" + "math/big" + "sync" + + caigotypes "github.com/smartcontractkit/caigo/types" + "golang.org/x/exp/maps" +) + +// TxStore tracks broadcast & unconfirmed txs +type TxStore struct { + lock sync.RWMutex + nonceToHash map[int64]string // map nonce to txhash + hashToNonce map[string]int64 // map hash to nonce + currentNonce *big.Int // minimum nonce +} + +func NewTxStore(current *big.Int) *TxStore { + return &TxStore{ + nonceToHash: map[int64]string{}, + hashToNonce: map[string]int64{}, + currentNonce: current, + } +} + +func (s *TxStore) Save(nonce *big.Int, hash string) error { + s.lock.Lock() + defer s.lock.Unlock() + + if s.currentNonce.Cmp(nonce) == 1 { + return fmt.Errorf("nonce too low: %s < %s (lowest)", nonce, s.currentNonce) + } + if h, exists := s.nonceToHash[nonce.Int64()]; exists { + return fmt.Errorf("nonce used: tried to use nonce (%s) for tx (%s), already used by (%s)", nonce, hash, h) + } + if n, exists := s.hashToNonce[hash]; exists { + return fmt.Errorf("hash used: tried to use tx (%s) for nonce (%s), already used nonce (%d)", hash, nonce, n) + } + + // store hash + s.nonceToHash[nonce.Int64()] = hash + s.hashToNonce[hash] = nonce.Int64() + + // find next unused nonce + _, exists := s.nonceToHash[s.currentNonce.Int64()] + for exists { + s.currentNonce.Add(s.currentNonce, big.NewInt(1)) + _, exists = s.nonceToHash[s.currentNonce.Int64()] + } + return nil +} + +func (s *TxStore) Confirm(hash string) error { + s.lock.Lock() + defer s.lock.Unlock() + + if nonce, exists := s.hashToNonce[hash]; exists { + delete(s.hashToNonce, hash) + delete(s.nonceToHash, nonce) + return nil + } + return fmt.Errorf("tx hash does not exist - it may already be confirmed: %s", hash) +} + +func (s *TxStore) GetUnconfirmed() []string { + s.lock.RLock() + defer s.lock.RUnlock() + return maps.Values(s.nonceToHash) +} + +func (s *TxStore) InflightCount() int { + s.lock.RLock() + defer s.lock.RUnlock() + return len(s.nonceToHash) +} + +type ChainTxStore struct { + store map[caigotypes.Hash]*TxStore + lock sync.RWMutex +} + +func NewChainTxStore() *ChainTxStore { + return &ChainTxStore{ + store: map[caigotypes.Hash]*TxStore{}, + } +} + +func (c *ChainTxStore) Save(from caigotypes.Hash, nonce *big.Int, hash string) error { + // use write lock for methods that modify underlying data + c.lock.Lock() + defer c.lock.Unlock() + if err := c.validate(from); err != nil { + // if does not exist, create a new store for the address + c.store[from] = NewTxStore(nonce) + } + return c.store[from].Save(nonce, hash) +} + +func (c *ChainTxStore) Confirm(from caigotypes.Hash, hash string) error { + // use write lock for methods that modify underlying data + c.lock.Lock() + defer c.lock.Unlock() + + if err := c.validate(from); err != nil { + return err + } + return c.store[from].Confirm(hash) +} + +func (c *ChainTxStore) GetAllInflightCount() map[caigotypes.Hash]int { + // use read lock for methods that read underlying data + c.lock.RLock() + defer c.lock.RUnlock() + + list := map[caigotypes.Hash]int{} + + for i := range c.store { + list[i] = c.store[i].InflightCount() + } + + return list +} + +func (c *ChainTxStore) GetAllUnconfirmed() map[caigotypes.Hash][]string { + // use read lock for methods that read underlying data + c.lock.RLock() + defer c.lock.RUnlock() + + list := map[caigotypes.Hash][]string{} + + for i := range c.store { + list[i] = c.store[i].GetUnconfirmed() + } + return list +} + +func (c *ChainTxStore) validate(from caigotypes.Hash) error { + if _, exists := c.store[from]; !exists { + return fmt.Errorf("from address does not exist: %s", from) + } + return nil +} \ No newline at end of file diff --git a/relayer/pkg/chainlink/txm/txstore_test.go b/relayer/pkg/chainlink/txm/txstore_test.go new file mode 100644 index 000000000..2c935ebc9 --- /dev/null +++ b/relayer/pkg/chainlink/txm/txstore_test.go @@ -0,0 +1,166 @@ +package txm + +import ( + "errors" + "fmt" + "math/big" + "sync" + "testing" + + caigotypes "github.com/smartcontractkit/caigo/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestTxStore(t *testing.T) { + t.Parallel() + + t.Run("happypath", func(t *testing.T) { + t.Parallel() + + s := NewTxStore(big.NewInt(0)) + assert.Equal(t, 0, s.InflightCount()) + require.NoError(t, s.Save(big.NewInt(0), "0x0")) + assert.Equal(t, 1, s.InflightCount()) + assert.Equal(t, []string{"0x0"}, s.GetUnconfirmed()) + require.NoError(t, s.Confirm("0x0")) + assert.Equal(t, 0, s.InflightCount()) + assert.Equal(t, []string{}, s.GetUnconfirmed()) + }) + + t.Run("save", func(t *testing.T) { + t.Parallel() + + // create + s := NewTxStore(big.NewInt(0)) + + // accepts tx in order + require.NoError(t, s.Save(big.NewInt(0), "0x0")) + assert.Equal(t, 1, s.InflightCount()) + assert.Equal(t, int64(1), s.currentNonce.Int64()) + + // accepts tx that skips a nonce + require.NoError(t, s.Save(big.NewInt(2), "0x2")) + assert.Equal(t, 2, s.InflightCount()) + assert.Equal(t, int64(1), s.currentNonce.Int64()) + + // accepts tx that fills in the missing nonce + fast forwards currentNonce + require.NoError(t, s.Save(big.NewInt(1), "0x1")) + assert.Equal(t, 3, s.InflightCount()) + assert.Equal(t, int64(3), s.currentNonce.Int64()) + + // skip a nonce for later tests + require.NoError(t, s.Save(big.NewInt(4), "0x4")) + assert.Equal(t, 4, s.InflightCount()) + assert.Equal(t, int64(3), s.currentNonce.Int64()) + + // rejects old nonce + require.ErrorContains(t, s.Save(big.NewInt(0), "0xold"), "nonce too low: 0 < 3 (lowest)") + assert.Equal(t, 4, s.InflightCount()) + + // reject already in use nonce + require.ErrorContains(t, s.Save(big.NewInt(4), "0xskip"), "nonce used: tried to use nonce (4) for tx (0xskip), already used by (0x4)") + assert.Equal(t, 4, s.InflightCount()) + + // reject already in use tx hash + require.ErrorContains(t, s.Save(big.NewInt(5), "0x0"), "hash used: tried to use tx (0x0) for nonce (5), already used nonce (0)") + assert.Equal(t, 4, s.InflightCount()) + + // race save + var err0 error + var err1 error + var wg sync.WaitGroup + wg.Add(2) + go func() { + err0 = s.Save(big.NewInt(10), "0x10") + wg.Done() + }() + go func() { + err1 = s.Save(big.NewInt(10), "0x10") + wg.Done() + }() + wg.Wait() + assert.True(t, !errors.Is(err0, err1) && (err0 != nil || err1 != nil)) + }) + + t.Run("confirm", func(t *testing.T) { + t.Parallel() + + // init store + s := NewTxStore(big.NewInt(0)) + for i := 0; i < 5; i++ { + require.NoError(t, s.Save(big.NewInt(int64(i)), "0x"+fmt.Sprintf("%d", i))) + } + + // confirm in order + require.NoError(t, s.Confirm("0x0")) + require.NoError(t, s.Confirm("0x1")) + assert.Equal(t, 3, s.InflightCount()) + + // confirm out of order + require.NoError(t, s.Confirm("0x4")) + require.NoError(t, s.Confirm("0x3")) + require.NoError(t, s.Confirm("0x2")) + assert.Equal(t, 0, s.InflightCount()) + + // confirm unknown/duplicate + require.ErrorContains(t, s.Confirm("0x2"), "tx hash does not exist - it may already be confirmed") + require.ErrorContains(t, s.Confirm("0xNULL"), "tx hash does not exist - it may already be confirmed") + + // race confirm + require.NoError(t, s.Save(big.NewInt(10), "0x10")) + var err0 error + var err1 error + var wg sync.WaitGroup + wg.Add(2) + go func() { + err0 = s.Confirm("0x10") + wg.Done() + }() + go func() { + err1 = s.Confirm("0x10") + wg.Done() + }() + wg.Wait() + assert.True(t, !errors.Is(err0, err1) && (err0 != nil || err1 != nil)) + }) +} + +func TestChainTxStore(t *testing.T) { + t.Parallel() + + c := NewChainTxStore() + + // automatically save the from address + require.NoError(t, c.Save(caigotypes.Hash{}, big.NewInt(0), "0x0")) + + // reject saving for existing address and reused hash & nonce + // error messages are tested within TestTxStore + assert.Error(t, c.Save(caigotypes.Hash{}, big.NewInt(0), "0x1")) + assert.Error(t, c.Save(caigotypes.Hash{}, big.NewInt(1), "0x0")) + + // inflight count + count, exists := c.GetAllInflightCount()[caigotypes.Hash{}] + require.True(t, exists) + assert.Equal(t, 1, count) + _, exists = c.GetAllInflightCount()[caigotypes.Hash{1}] + require.False(t, exists) + + // get unconfirmed + list := c.GetAllUnconfirmed() + assert.Equal(t, 1, len(list)) + hashes, ok := list[caigotypes.Hash{}] + assert.True(t, ok) + assert.Equal(t, []string{"0x0"}, hashes) + + // confirm + assert.NoError(t, c.Confirm(caigotypes.Hash{}, "0x0")) + assert.ErrorContains(t, c.Confirm(caigotypes.Hash{1}, "0x0"), "from address does not exist") + assert.Error(t, c.Confirm(caigotypes.Hash{}, "0x1")) + list = c.GetAllUnconfirmed() + assert.Equal(t, 1, len(list)) + assert.Equal(t, 0, len(list[caigotypes.Hash{}])) + count, exists = c.GetAllInflightCount()[caigotypes.Hash{}] + assert.True(t, exists) + assert.Equal(t, 0, count) +} \ No newline at end of file diff --git a/relayer/pkg/starknet/client.go b/relayer/pkg/starknet/client.go index 7ae9dbb71..83d17690c 100644 --- a/relayer/pkg/starknet/client.go +++ b/relayer/pkg/starknet/client.go @@ -211,7 +211,7 @@ func (c *Client) AccountNonce(ctx context.Context, address caigotypes.Hash) (*bi defer cancel() } - out, err := c.Gw.AccountNonce(ctx, address) + out, err := c.Gw.Nonce(ctx, address.String(), "") if err != nil { return out, errors.Wrap(err, "error in client.AccountNonce") } diff --git a/relayer/pkg/starknet/mocks/Reader.go b/relayer/pkg/starknet/mocks/Reader.go index 3a40d2d25..e78c9fad4 100644 --- a/relayer/pkg/starknet/mocks/Reader.go +++ b/relayer/pkg/starknet/mocks/Reader.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks @@ -25,6 +25,10 @@ func (_m *Reader) BlockByHash(_a0 context.Context, _a1 string, _a2 string) (*gat ret := _m.Called(_a0, _a1, _a2) var r0 *gateway.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*gateway.Block, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *gateway.Block); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -33,7 +37,6 @@ func (_m *Reader) BlockByHash(_a0 context.Context, _a1 string, _a2 string) (*gat } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -48,6 +51,10 @@ func (_m *Reader) BlockByNumber(_a0 context.Context, _a1 *big.Int, _a2 string) ( ret := _m.Called(_a0, _a1, _a2) var r0 *gateway.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *big.Int, string) (*gateway.Block, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, *big.Int, string) *gateway.Block); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -56,7 +63,6 @@ func (_m *Reader) BlockByNumber(_a0 context.Context, _a1 *big.Int, _a2 string) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *big.Int, string) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -71,6 +77,10 @@ func (_m *Reader) BlockByNumberGateway(_a0 context.Context, _a1 uint64) (*gatewa ret := _m.Called(_a0, _a1) var r0 *gateway.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (*gateway.Block, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) *gateway.Block); ok { r0 = rf(_a0, _a1) } else { @@ -79,7 +89,6 @@ func (_m *Reader) BlockByNumberGateway(_a0 context.Context, _a1 uint64) (*gatewa } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(_a0, _a1) } else { @@ -94,6 +103,10 @@ func (_m *Reader) Call(_a0 context.Context, _a1 types.FunctionCall, _a2 string) ret := _m.Called(_a0, _a1, _a2) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.FunctionCall, string) ([]string, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, types.FunctionCall, string) []string); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -102,7 +115,6 @@ func (_m *Reader) Call(_a0 context.Context, _a1 types.FunctionCall, _a2 string) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.FunctionCall, string) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -117,6 +129,10 @@ func (_m *Reader) CallContract(_a0 context.Context, _a1 starknet.CallOps) ([]str ret := _m.Called(_a0, _a1) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, starknet.CallOps) ([]string, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, starknet.CallOps) []string); ok { r0 = rf(_a0, _a1) } else { @@ -125,7 +141,6 @@ func (_m *Reader) CallContract(_a0 context.Context, _a1 starknet.CallOps) ([]str } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, starknet.CallOps) error); ok { r1 = rf(_a0, _a1) } else { @@ -140,13 +155,16 @@ func (_m *Reader) ChainID(_a0 context.Context) (string, error) { ret := _m.Called(_a0) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) string); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -161,13 +179,16 @@ func (_m *Reader) LatestBlockHeight(_a0 context.Context) (uint64, error) { ret := _m.Called(_a0) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { diff --git a/relayer/pkg/starknet/utils.go b/relayer/pkg/starknet/utils.go index 1e8955a4a..6783a644d 100644 --- a/relayer/pkg/starknet/utils.go +++ b/relayer/pkg/starknet/utils.go @@ -6,14 +6,16 @@ import ( "fmt" "math/big" - junotypes "github.com/NethermindEth/juno/pkg/types" caigotypes "github.com/smartcontractkit/caigo/types" "github.com/pkg/errors" "golang.org/x/exp/constraints" ) -const chunkSize = 31 +const ( + FeltLength = 32 + chunkSize = 31 +) // padd bytes to specific length func PadBytes(a []byte, length int) []byte { @@ -105,8 +107,8 @@ func FeltToSignedBig(felt *caigotypes.Felt) (num *big.Int) { } func HexToSignedBig(str string) (num *big.Int) { - felt := junotypes.HexToFelt(str) - return FeltToSignedBig(&caigotypes.Felt{Int: felt.Big()}) + felt := caigotypes.StrToFelt(str) + return FeltToSignedBig(felt) } func FeltsToBig(in []*caigotypes.Felt) (out []*big.Int) { diff --git a/shell.nix b/shell.nix index 6ec724508..f81253978 100644 --- a/shell.nix +++ b/shell.nix @@ -11,8 +11,9 @@ python39Packages.fastecdsa # so libgmp is correctly sourced zlib # for numpy gmp - nodejs-18_x - (yarn.override { nodejs = nodejs-18_x; }) + # use nodejs 16.x due to https://github.com/NomicFoundation/hardhat/issues/3877 + nodejs-16_x + (yarn.override { nodejs = nodejs-16_x; }) nodePackages.typescript nodePackages.typescript-language-server nodePackages.npm diff --git a/vendor/cairo b/vendor/cairo index 05867c82d..4e32aa52e 160000 --- a/vendor/cairo +++ b/vendor/cairo @@ -1 +1 @@ -Subproject commit 05867c82de42d5ee5cfa953dcca1cb826402f74b +Subproject commit 4e32aa52e1109ffaf92543c1c526f0fb51ec462a diff --git a/vendor/scarb b/vendor/scarb index f9c07ce68..0bccfe675 160000 --- a/vendor/scarb +++ b/vendor/scarb @@ -1 +1 @@ -Subproject commit f9c07ce6898204511522ec585689cfb9001782a3 +Subproject commit 0bccfe6754ee91e0365a0854a38df2e4e2f6ff77