From 5507ac97592797f0635cfdfd95ed8005ce89f8c3 Mon Sep 17 00:00:00 2001 From: stackman27 Date: Mon, 11 Dec 2023 13:59:01 -0800 Subject: [PATCH] added --- .github/workflows/on-demand-ocr-soak-test.yml | 1 + common/config/chaintype.go | 5 ++-- .../config/toml/defaults/Bttc_testnet.toml | 28 +++++++++++++++++++ .../contracts/contract_deployer.go | 6 ++++ integration-tests/go.mod | 2 +- integration-tests/go.sum | 2 ++ 6 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 core/chains/evm/config/toml/defaults/Bttc_testnet.toml diff --git a/.github/workflows/on-demand-ocr-soak-test.yml b/.github/workflows/on-demand-ocr-soak-test.yml index 567d9510de9..74ce85764d5 100644 --- a/.github/workflows/on-demand-ocr-soak-test.yml +++ b/.github/workflows/on-demand-ocr-soak-test.yml @@ -30,6 +30,7 @@ on: - "KROMA_SEPOLIA" - "WEMIX_TESTNET" - "WEMIX_MAINNET" + - "BTTC_TESTNET" fundingPrivateKey: description: Private funding key (Skip for Simulated) required: false diff --git a/common/config/chaintype.go b/common/config/chaintype.go index 21fb8cd297d..dc88f7b8758 100644 --- a/common/config/chaintype.go +++ b/common/config/chaintype.go @@ -18,16 +18,17 @@ const ( ChainWeMix ChainType = "wemix" ChainKroma ChainType = "kroma" ChainZkSync ChainType = "zksync" + ChainBttc ChainType = "bttc" ) var ErrInvalidChainType = fmt.Errorf("must be one of %s or omitted", strings.Join([]string{ string(ChainArbitrum), string(ChainMetis), string(ChainXDai), string(ChainOptimismBedrock), string(ChainCelo), - string(ChainKroma), string(ChainWeMix), string(ChainZkSync)}, ", ")) + string(ChainKroma), string(ChainWeMix), string(ChainZkSync), string(ChainBttc)}, ", ")) // IsValid returns true if the ChainType value is known or empty. func (c ChainType) IsValid() bool { switch c { - case "", ChainArbitrum, ChainMetis, ChainOptimismBedrock, ChainXDai, ChainCelo, ChainKroma, ChainWeMix, ChainZkSync: + case "", ChainArbitrum, ChainMetis, ChainOptimismBedrock, ChainXDai, ChainCelo, ChainKroma, ChainWeMix, ChainZkSync, ChainBttc: return true } return false diff --git a/core/chains/evm/config/toml/defaults/Bttc_testnet.toml b/core/chains/evm/config/toml/defaults/Bttc_testnet.toml new file mode 100644 index 00000000000..707b9c0223c --- /dev/null +++ b/core/chains/evm/config/toml/defaults/Bttc_testnet.toml @@ -0,0 +1,28 @@ +ChainID = '1029' +FinalityDepth = 9000 +# blocks are generated every 2-4s +LogPollInterval = '2s' +# Blocks are only emitted when a transaction happens / no empty blocks +NoNewHeadsThreshold = '0' + +[GasEstimator] +EIP1559DynamicFees = false + + +[GasEstimator.BlockHistory] +# how many blocks we want to keep in memory to calculate gas price +# # Average block time of 2s +BlockHistorySize = 24 + +[Transactions] +ResendAfterThreshold = '30s' + +[HeadTracker] +# re-org for bttc is really high so we want to check for the block where reorg happens +HistoryDepth = 500 + +[NodePool] +SyncThreshold = 10 + +[OCR] +ContractConfirmations = 1 \ No newline at end of file diff --git a/integration-tests/contracts/contract_deployer.go b/integration-tests/contracts/contract_deployer.go index 528f07ec68e..4943dbd907a 100644 --- a/integration-tests/contracts/contract_deployer.go +++ b/integration-tests/contracts/contract_deployer.go @@ -181,6 +181,8 @@ func NewContractDeployer(bcClient blockchain.EVMClient, logger zerolog.Logger) ( return &KromaContractDeployer{NewEthereumContractDeployer(clientImpl, logger)}, nil case *blockchain.WeMixClient: return &WeMixContractDeployer{NewEthereumContractDeployer(clientImpl, logger)}, nil + case *blockchain.BttcClient: + return &BttcContractDeployer{NewEthereumContractDeployer(clientImpl, logger)}, nil } return nil, errors.New("unknown blockchain client implementation for contract deployer, register blockchain client in NewContractDeployer") } @@ -256,6 +258,10 @@ type WeMixContractDeployer struct { *EthereumContractDeployer } +type BttcContractDeployer struct { + *EthereumContractDeployer +} + // NewEthereumContractDeployer returns an instantiated instance of the ETH contract deployer func NewEthereumContractDeployer(ethClient blockchain.EVMClient, logger zerolog.Logger) *EthereumContractDeployer { return &EthereumContractDeployer{ diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 5b44209f9a6..c13338b504a 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -25,7 +25,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.1 github.com/smartcontractkit/chainlink-common v0.1.7-0.20231206181640-faad3f11cfad - github.com/smartcontractkit/chainlink-testing-framework v1.21.0 + github.com/smartcontractkit/chainlink-testing-framework v1.22.1-0.20231211214733-01e7b517d5a6 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20231130143053-c5102a9c0fb7 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 0e29f6f6715..86a059c8426 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1534,6 +1534,8 @@ github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.202312 github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231205180940-ea2e3e916725/go.mod h1:vHrPBipRL52NdPp77KXNU2k1IoCUa1B33N9otZQPYko= github.com/smartcontractkit/chainlink-testing-framework v1.21.0 h1:MrtpGMgPpcRX06FtDEj14Vokoo6Sx8e0/D6AA9LxCgM= github.com/smartcontractkit/chainlink-testing-framework v1.21.0/go.mod h1:9SCqZ+lcWZNEofpPgasQ+wUF6A6fFgZvWmhqQJwFYV0= +github.com/smartcontractkit/chainlink-testing-framework v1.22.1-0.20231211214733-01e7b517d5a6 h1:pAJ4ogR1OQSwmVMmUtMAEOLH5N4wIOEdwL/izuJj6v0= +github.com/smartcontractkit/chainlink-testing-framework v1.22.1-0.20231211214733-01e7b517d5a6/go.mod h1:yu6qqrppNJfutQV37fiSs4eS0uQP5QT0ebi3tlIgWN0= github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 h1:FFdvEzlYwcuVHkdZ8YnZR/XomeMGbz5E2F2HZI3I3w8= github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868/go.mod h1:Kn1Hape05UzFZ7bOUnm3GVsHzP0TNrVmpfXYNHdqGGs= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss=