Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCF-2492 Remove evm default chain id #10490

Merged
merged 56 commits into from
Sep 14, 2023
Merged

Conversation

ilija42
Copy link
Contributor

@ilija42 ilija42 commented Sep 5, 2023

Remove all usage of default chainID:

  • Add job spec validation in job orm CreateJob that checks if evmChainID is defined for every job type that has EVMChainID in its spec
  • All pipeline vars now pass evmChainID inside of the jobSpec vars
  • Add default value for parsing pipeline evmChainID var for EstimateGasLimitTask, ETHCallTask and ETHTxTask
  • Remove keystore migrations from v1 to v2. Migrations used default ChainID, and it turned out that the migrations from v1 to v2 are obsolete, so it was easier just to remove it completely

For all job specs evmChainID field got injected with the default chain ID on job creation so all existing jobs would be valid. But if NOPs externally stored some old job specs, they won't have evmChainID defined in them and after these changes get merged evmChainID won't be implicitly injected anymore. I talked to Brendon and this should be fine.

Also a lot of tests relied on DefaultChainID, so most of the changes are to pass evmChainID where needed in tests.

 - Remove default chain id from LegacyChainContainer
 - Add alternate function for default chainID in tests
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

I see that you haven't updated any README files. Would it make sense to do so?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

 - Remove default chain id from LoopRelayAdapter
 - Remove default chain id use from common.go getChain
 - Remove default chain id use from evm relayer init
- Remove code that relied on default chainID
- Fix evm transfer controller tests
- Fix integration test helpers
- Fix head tracker tests
- Fix evm transaction commands test
…fault-evm-chainID

# Conflicts:
#	core/internal/cltest/mocks.go
#	core/services/chainlink/relayer_chain_interoperators.go
#	core/services/relay/evm/mocks/loop_relay_adapter.go
#	core/services/relay/evm/relayer_extender.go
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

samsondav
samsondav previously approved these changes Sep 13, 2023
Copy link
Collaborator

@samsondav samsondav left a comment

Choose a reason for hiding this comment

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

Very good! I've been wanting to see this gone for years

@jmank88
Copy link
Contributor

jmank88 commented Sep 14, 2023

These changes require all jobs that need evmChainID to provide it and aren't backwards comaptible.

Normally we would provide a migration to auto-upgrade the jobs so that this is a non-issue. Was this considered?

…fault-evm-chainID

# Conflicts:
#	core/cmd/shell_remote_test.go
#	core/web/common.go
@ilija42
Copy link
Contributor Author

ilija42 commented Sep 14, 2023

These changes require all jobs that need evmChainID to provide it and aren't backwards comaptible.

Normally we would provide a migration to auto-upgrade the jobs so that this is a non-issue. Was this considered?

I think I didn't explain the issue properly, there wouldn't be any issue with existing created jobs, just with old job specs that don't have evmChainID defined, depending on how NOPs usually store jobspecs.
For eg. if NOP stored a jobspec in some txt file, on job creation this jobspecs evmChainID field gets injected with defaultChainID and gets saved to DB(so all existing jobs would be valid). But There still exists a copy of that jobspec in the txt file without injected evmChainID and it wouldn't work if evmChainID wasn't manually added to it.

RyanRHall
RyanRHall previously approved these changes Sep 14, 2023
Copy link
Contributor

@RyanRHall RyanRHall left a comment

Choose a reason for hiding this comment

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

I only looked at keystore migration code, but removing all of that looks wonderful to me :)

@ilija42 ilija42 requested a review from krehermann September 14, 2023 15:30
Copy link
Contributor

@krehermann krehermann left a comment

Choose a reason for hiding this comment

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

let's add something to the change log

@cl-sonarqube-production
Copy link

@ilija42 ilija42 added this pull request to the merge queue Sep 14, 2023
Merged via the queue into develop with commit c9e080b Sep 14, 2023
98 checks passed
@ilija42 ilija42 deleted the BCF-2492-remove-default-evm-chainID branch September 14, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants