Skip to content

Commit

Permalink
Merge branch 'develop' into BCI-3271-refactor-write-capability-chainw…
Browse files Browse the repository at this point in the history
…riter
  • Loading branch information
patrick-dowell authored May 27, 2024
2 parents 2ae8633 + d675d86 commit 025bb16
Show file tree
Hide file tree
Showing 180 changed files with 4,101 additions and 1,006 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-bats-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Reducing the scope of 0233 migration to include only 5th word index which is required for CCIP #db_update
5 changes: 5 additions & 0 deletions .changeset/cool-readers-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal add modify DON function to capability registry
5 changes: 5 additions & 0 deletions .changeset/curvy-pandas-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal add getters in capability registry
5 changes: 5 additions & 0 deletions .changeset/giant-hats-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal update ICapabilityConfiguration interface
5 changes: 5 additions & 0 deletions .changeset/metal-horses-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal implement remove DONs in capability registry
5 changes: 5 additions & 0 deletions .changeset/red-eagles-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

#added Added an auto-purge feature to the EVM TXM that identifies terminally stuck transactions either through a chain specific method or heurisitic then purges them to unblock the nonce. Included 4 new toml configs under Transactions.AutoPurge to configure this new feature: Enabled, Threshold, MinAttempts, and DetectionApiUrl.
5 changes: 5 additions & 0 deletions .changeset/sharp-plums-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Add option to include GasPriceSubunits pipeline to include gasPriceSubunits in median ocr2 transmission (only to be used with Starknet chain for now) #added #nops #updated
5 changes: 5 additions & 0 deletions .changeset/thin-schools-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal track config count in DON struct
5 changes: 5 additions & 0 deletions .changeset/two-papayas-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal update node signer type
5 changes: 5 additions & 0 deletions .changeset/young-candles-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#bugfix allow ChainType to be set to xdai
26 changes: 12 additions & 14 deletions .github/workflows/client-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ jobs:
client: nethermind
timeout: 30m
pyroscope_env: ci-smoke-ocr-nethermind-simulated
# Will fail until https://github.com/hyperledger/besu/pull/6702 is merged and released
# - name: ocr-besu
# test: TestOCRBasic
# file: ocr
# client: besu
# timeout: 30m
# pyroscope_env: ci-smoke-ocr-besu-simulated
- name: ocr-besu
test: TestOCRBasic
file: ocr
client: besu
timeout: 30m
pyroscope_env: ci-smoke-ocr-besu-simulated
- name: ocr-erigon
test: TestOCRBasic
file: ocr
Expand All @@ -136,13 +135,12 @@ jobs:
client: nethermind
timeout: 30m
pyroscope_env: ci-smoke-nethermind-evm-simulated
# Will fail until https://github.com/hyperledger/besu/pull/6702 is merged and released
# - name: ocr2-besu
# test: "^TestOCRv2Basic/plugins$"
# file: ocr2
# client: besu
# timeout: 30m
# pyroscope_env: ci-smoke-ocr2-besu-simulated
- name: ocr2-besu
test: "^TestOCRv2Basic/plugins$"
file: ocr2
client: besu
timeout: 30m
pyroscope_env: ci-smoke-ocr2-besu-simulated
- name: ocr2-erigon
test: "^TestOCRv2Basic/plugins$"
file: ocr2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
- '**/*go.mod'
- '.github/workflows/integration-tests.yml'
- '**/*Dockerfile'
- 'core/**/migrations/*.sql'
- 'core/**/config/**/*.toml'
- 'integration-tests/**/*.toml'
- name: Ignore Filter On Workflow Dispatch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solidity-foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- '.github/workflows/solidity-foundry.yml'
- 'contracts/foundry.toml'
- 'contracts/gas-snapshots/*.gas-snapshot'
- 'contracts/foundry-lib'
- 'contracts/foundry-lib/**/*'
- '.gitmodules'
tests:
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ golang 1.21.7
mockery 2.42.2
nodejs 20.13.1
pnpm 8.15.8
postgres 14.11
postgres 15.1
helm 3.10.3
zig 0.11.0
golangci-lint 1.55.2
Expand Down
121 changes: 97 additions & 24 deletions common/config/chaintype.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import (
"strings"
)

// ChainType denotes the chain or network to work with
type ChainType string

// nolint
const (
ChainArbitrum ChainType = "arbitrum"
ChainCelo ChainType = "celo"
Expand All @@ -18,11 +16,106 @@ const (
ChainOptimismBedrock ChainType = "optimismBedrock"
ChainScroll ChainType = "scroll"
ChainWeMix ChainType = "wemix"
ChainXDai ChainType = "xdai" // Deprecated: use ChainGnosis instead
ChainXLayer ChainType = "xlayer"
ChainZkEvm ChainType = "zkevm"
ChainZkSync ChainType = "zksync"
)

// IsL2 returns true if this chain is a Layer 2 chain. Notably:
// - the block numbers used for log searching are different from calling block.number
// - gas bumping is not supported, since there is no tx mempool
func (c ChainType) IsL2() bool {
switch c {
case ChainArbitrum, ChainMetis:
return true
default:
return false
}
}

func (c ChainType) IsValid() bool {
switch c {
case "", ChainArbitrum, ChainCelo, ChainGnosis, ChainKroma, ChainMetis, ChainOptimismBedrock, ChainScroll, ChainWeMix, ChainXLayer, ChainZkEvm, ChainZkSync:
return true
}
return false
}

func ChainTypeFromSlug(slug string) ChainType {
switch slug {
case "arbitrum":
return ChainArbitrum
case "celo":
return ChainCelo
case "gnosis", "xdai":
return ChainGnosis
case "kroma":
return ChainKroma
case "metis":
return ChainMetis
case "optimismBedrock":
return ChainOptimismBedrock
case "scroll":
return ChainScroll
case "wemix":
return ChainWeMix
case "xlayer":
return ChainXLayer
case "zkevm":
return ChainZkEvm
case "zksync":
return ChainZkSync
default:
return ChainType(slug)
}
}

type ChainTypeConfig struct {
value ChainType
slug string
}

func NewChainTypeConfig(slug string) *ChainTypeConfig {
return &ChainTypeConfig{
value: ChainTypeFromSlug(slug),
slug: slug,
}
}

func (c *ChainTypeConfig) MarshalText() ([]byte, error) {
if c == nil {
return nil, nil
}
return []byte(c.slug), nil
}

func (c *ChainTypeConfig) UnmarshalText(b []byte) error {
c.slug = string(b)
c.value = ChainTypeFromSlug(c.slug)
return nil
}

func (c *ChainTypeConfig) Slug() string {
if c == nil {
return ""
}
return c.slug
}

func (c *ChainTypeConfig) ChainType() ChainType {
if c == nil {
return ""
}
return c.value
}

func (c *ChainTypeConfig) String() string {
if c == nil {
return ""
}
return string(c.value)
}

var ErrInvalidChainType = fmt.Errorf("must be one of %s or omitted", strings.Join([]string{
string(ChainArbitrum),
string(ChainCelo),
Expand All @@ -33,26 +126,6 @@ var ErrInvalidChainType = fmt.Errorf("must be one of %s or omitted", strings.Joi
string(ChainScroll),
string(ChainWeMix),
string(ChainXLayer),
string(ChainZkEvm),
string(ChainZkSync),
}, ", "))

// IsValid returns true if the ChainType value is known or empty.
func (c ChainType) IsValid() bool {
switch c {
case "", ChainArbitrum, ChainCelo, ChainGnosis, ChainKroma, ChainMetis, ChainOptimismBedrock, ChainScroll, ChainWeMix, ChainXDai, ChainXLayer, ChainZkSync:
return true
}
return false
}

// IsL2 returns true if this chain is a Layer 2 chain. Notably:
// - the block numbers used for log searching are different from calling block.number
// - gas bumping is not supported, since there is no tx mempool
func (c ChainType) IsL2() bool {
switch c {
case ChainArbitrum, ChainMetis:
return true
default:
return false
}
}
Loading

0 comments on commit 025bb16

Please sign in to comment.