Skip to content

Commit

Permalink
Remove xdai ChainType Option [SHIP-1077] (#13354)
Browse files Browse the repository at this point in the history
* Remove xdai ChainType option

* Add changeset
  • Loading branch information
friedemannf committed Jun 3, 2024
1 parent 3d700a8 commit 58d73ec
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 135 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-items-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

#breaking_change Remove the `xdai` `ChainType` config option. Moving forward, only `gnosis` can be used.
2 changes: 1 addition & 1 deletion common/config/chaintype.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func ChainTypeFromSlug(slug string) ChainType {
return ChainArbitrum
case "celo":
return ChainCelo
case "gnosis", "xdai":
case "gnosis":
return ChainGnosis
case "kroma":
return ChainKroma
Expand Down
2 changes: 0 additions & 2 deletions core/config/docs/chains-evm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ BlockBackfillDepth = 10 # Default
BlockBackfillSkip = false # Default
# ChainType is automatically detected from chain ID. Set this to force a certain chain type regardless of chain ID.
# Available types: `arbitrum`, `celo`, `gnosis`, `kroma`, `metis`, `optimismBedrock`, `scroll`, `wemix`, `xlayer`, `zksync`
#
# `xdai` has been deprecated and will be removed in v2.13.0, use `gnosis` instead.
ChainType = 'arbitrum' # Example
# FinalityDepth is the number of blocks after which an ethereum transaction is considered "final". Note that the default is automatically set based on chain ID, so it should not be necessary to change this under normal operation.
# BlocksConsideredFinal determines how deeply we look back to ensure that transactions are confirmed onto the longest chain
Expand Down
12 changes: 1 addition & 11 deletions core/services/chainlink/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,7 @@ func (c *Config) valueWarnings() (err error) {
// deprecationWarnings returns an error if the Config contains deprecated fields.
// This is typically used before defaults have been applied, with input from the user.
func (c *Config) deprecationWarnings() (err error) {
// ChainType xdai is deprecated and has been renamed to gnosis
for _, evm := range c.EVM {
if evm.ChainType != nil && evm.ChainType.Slug() == "xdai" {
err = multierr.Append(err, config.ErrInvalid{
Name: "EVM.ChainType",
Value: evm.ChainType.Slug(),
Msg: "deprecated and will be removed in v2.13.0, use 'gnosis' instead",
})
}
}
return
return nil
}

// Validate returns an error if the Config is not valid for use, as-is.
Expand Down
7 changes: 0 additions & 7 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1647,13 +1647,6 @@ func TestConfig_warnings(t *testing.T) {
},
expectedErrors: []string{"Tracing.TLSCertPath: invalid value (/path/to/cert.pem): must be empty when Tracing.Mode is 'unencrypted'"},
},
{
name: "Value warning - ChainType=xdai is deprecated",
config: Config{
EVM: evmcfg.EVMConfigs{{Chain: evmcfg.Chain{ChainType: commonconfig.NewChainTypeConfig("xdai")}}},
},
expectedErrors: []string{"EVM.ChainType: invalid value (xdai): deprecated and will be removed in v2.13.0, use 'gnosis' instead"},
},
}

for _, tt := range tests {
Expand Down
2 changes: 0 additions & 2 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7076,8 +7076,6 @@ ChainType = 'arbitrum' # Example
ChainType is automatically detected from chain ID. Set this to force a certain chain type regardless of chain ID.
Available types: `arbitrum`, `celo`, `gnosis`, `kroma`, `metis`, `optimismBedrock`, `scroll`, `wemix`, `xlayer`, `zksync`

`xdai` has been deprecated and will be removed in v2.13.0, use `gnosis` instead.

### FinalityDepth
```toml
FinalityDepth = 50 # Default
Expand Down
113 changes: 1 addition & 112 deletions testdata/scripts/node/validate/warnings.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ CollectorTarget = 'otel-collector:4317'
TLSCertPath = 'something'
Mode = 'unencrypted'

[[EVM]]
ChainID = '10200'
ChainType = 'xdai'

[[EVM.Nodes]]
Name = 'fake'
WSURL = 'wss://foo.bar/ws'
HTTPURL = 'https://foo.bar'

-- secrets.toml --
[Database]
URL = 'postgresql://user:pass1234567890abcd@localhost:5432/dbname?sslmode=disable'
Expand All @@ -41,15 +32,6 @@ CollectorTarget = 'otel-collector:4317'
Mode = 'unencrypted'
TLSCertPath = 'something'

[[EVM]]
ChainID = '10200'
ChainType = 'xdai'

[[EVM.Nodes]]
Name = 'fake'
WSURL = 'wss://foo.bar/ws'
HTTPURL = 'https://foo.bar'

# Effective Configuration, with defaults applied:
InsecureFastScrypt = false
RootDir = '~/.chainlink'
Expand Down Expand Up @@ -302,99 +284,6 @@ DeltaDial = '15s'
DeltaReconcile = '1m0s'
ListenAddresses = []

[[EVM]]
ChainID = '10200'
AutoCreateKey = true
BlockBackfillDepth = 10
BlockBackfillSkip = false
ChainType = 'xdai'
FinalityDepth = 100
FinalityTagEnabled = false
LogBackfillBatchSize = 1000
LogPollInterval = '5s'
LogKeepBlocksDepth = 100000
LogPrunePageSize = 0
BackupLogPollerBlockDelay = 100
MinIncomingConfirmations = 3
MinContractPayment = '0.00001 link'
NonceAutoSync = true
NoNewHeadsThreshold = '3m0s'
RPCDefaultBatchSize = 250
RPCBlockQueryDelay = 1

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
MaxQueued = 250
ReaperInterval = '1h0m0s'
ReaperThreshold = '168h0m0s'
ResendAfterThreshold = '1m0s'

[EVM.Transactions.AutoPurge]
Enabled = false

[EVM.BalanceMonitor]
Enabled = true

[EVM.GasEstimator]
Mode = 'BlockHistory'
PriceDefault = '20 gwei'
PriceMax = '500 gwei'
PriceMin = '1 gwei'
LimitDefault = 500000
LimitMax = 500000
LimitMultiplier = '1'
LimitTransfer = 21000
BumpMin = '5 gwei'
BumpPercent = 20
BumpThreshold = 3
EIP1559DynamicFees = true
FeeCapDefault = '100 gwei'
TipCapDefault = '1 wei'
TipCapMin = '1 wei'

[EVM.GasEstimator.BlockHistory]
BatchSize = 25
BlockHistorySize = 8
CheckInclusionBlocks = 12
CheckInclusionPercentile = 90
TransactionPercentile = 60

[EVM.HeadTracker]
HistoryDepth = 100
MaxBufferSize = 3
SamplingInterval = '1s'
MaxAllowedFinalityDepth = 10000
FinalityTagBypass = true

[EVM.NodePool]
PollFailureThreshold = 5
PollInterval = '10s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
LeaseDuration = '0s'
NodeIsSyncingEnabled = false
FinalizedBlockPollInterval = '5s'

[EVM.OCR]
ContractConfirmations = 4
ContractTransmitterTransmitTimeout = '10s'
DatabaseTimeout = '10s'
DeltaCOverride = '168h0m0s'
DeltaCJitterOverride = '1h0m0s'
ObservationGracePeriod = '1s'

[EVM.OCR2]
[EVM.OCR2.Automation]
GasLimit = 5400000

[[EVM.Nodes]]
Name = 'fake'
WSURL = 'wss://foo.bar/ws'
HTTPURL = 'https://foo.bar'

# Configuration warning:
2 errors:
- EVM.ChainType: invalid value (xdai): deprecated and will be removed in v2.13.0, use 'gnosis' instead
- Tracing.TLSCertPath: invalid value (something): must be empty when Tracing.Mode is 'unencrypted'
Tracing.TLSCertPath: invalid value (something): must be empty when Tracing.Mode is 'unencrypted'
Valid configuration.

0 comments on commit 58d73ec

Please sign in to comment.