Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Conversation

@matYang
Copy link
Collaborator

@matYang matYang commented Oct 9, 2024

Motivation

Mantle chaintype is no longer used by the BIX team, Mantle's chaintype has been changed to optimism in chain toml

Solution

In order to match for Mantle and apply custom gas price interceptor, we can check for evm ChainId.

Not going for a more generic solution given OCR2 plugins will be sunset soon, and Mantle should be the only chain that requires such custom logic before that.

This is already included in 1.5.4 release and verified to work. Back-porting here to dev branch.

return nil, iErr
if r.chain.Config().EVM().ChainID().Uint64() == 5003 || r.chain.Config().EVM().ChainID().Uint64() == 5000 {
if commitPluginConfig.IsSourceProvider {
mantleInterceptor, iErr := mantle.NewInterceptor(ctx, r.chain.Client())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, but iErr looks weird. I think the Go pattern is to have just err, no matter of the context. If err is already used (or defined in outer scope) you just go with err1, err2 etc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially, it was my implementation :) Linter argued about the shadowed declaration. So, InterceptorError => iErr :)

return nil, iErr
if r.chain.Config().EVM().ChainID().Uint64() == 5003 || r.chain.Config().EVM().ChainID().Uint64() == 5000 {
if !execPluginConfig.IsSourceProvider {
mantleInterceptor, iErr := mantle.NewInterceptor(ctx, r.chain.Client())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@matYang matYang enabled auto-merge (squash) October 11, 2024 20:44
@matYang matYang merged commit 918ccf6 into ccip-develop Oct 11, 2024
@matYang matYang deleted the port-mantle-chainid-detection branch October 11, 2024 21:00
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
50.0% Coverage on New Code (required ≥ 75%)

See analysis details on SonarQube

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants