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

[DPA-1367]: feat(deployment/mcms): update test helpers #16248

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

graham-chainlink
Copy link
Collaborator

Add equivalent test helpers which use the new MCMS library

Also updated the changeset link transfer to use the new helpers as a way to test the new changes.

JIRA: https://smartcontract-it.atlassian.net/browse/DPA-1367

Copy link
Contributor

github-actions bot commented Feb 6, 2025

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@graham-chainlink graham-chainlink force-pushed the ggoh/DPA-1367/test-helpers branch from 9957c47 to 13d91cd Compare February 6, 2025 03:42
ecPablo
ecPablo previously approved these changes Feb 6, 2025
Base automatically changed from ggoh/DPA-1356/BuildProposalFromBatch to develop February 7, 2025 00:14
@graham-chainlink graham-chainlink dismissed ecPablo’s stale review February 7, 2025 00:14

The base branch was changed.

@github-actions github-actions bot requested a review from a team as a code owner February 7, 2025 00:14

timelockAddress := mcmsState.Timelock.Address().Hex()

proposerAddressPerChain[uint64(chainID)] = mcmsState.ProposerMcm.Address().Hex()

Choose a reason for hiding this comment

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

this is confusing; why not use chainSelector instead of uint64(chainID)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, i was copy pasting from the original implementation. Fixed it!


allBatches := []mcmstypes.BatchOperation{}
for chainSelector := range cfg.Transfers {
chainID := mcmstypes.ChainSelector(chainSelector)

Choose a reason for hiding this comment

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

[nit] I'm not sure we need this variable. And the name is misleading, as we typically use "chain id" to refer to EVM's chain ids...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, i cleaned it up by inlining it since it was used in 1 place only

@graham-chainlink graham-chainlink force-pushed the ggoh/DPA-1367/test-helpers branch from 13d91cd to 1591e75 Compare February 7, 2025 03:13
Add equivalent test helpers which use the new MCMS library

Also updated the changeset link transfer to use the new helpers as a way to test the new changes.

JIRA: https://smartcontract-it.atlassian.net/browse/DPA-1367

Co-authored-by: ajaskolski <[email protected]>
}

proposalutils.ExecuteMCMSProposalV2(t, e, p, sel)
proposalutils.ExecuteMCMSTimelockProposalV2(t, e, &prop, sel)

Choose a reason for hiding this comment

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

are you sure we should execute the timelock proposal here? I think we have to wait until the operation is ready, no? My understanding is this would be done through the CI.

Copy link
Collaborator Author

@graham-chainlink graham-chainlink Feb 7, 2025

Choose a reason for hiding this comment

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

this is the test helper, so we use this helper in tests to execute the changeset immediately so we can verify the behaviour

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so the line proposalutils.ExecuteMCMSProposalV2 makes the timelock proposal ready for execution, then ExecuteMCMSTimelockProposalV2 executes it.

Choose a reason for hiding this comment

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

I thought the line proposalutils.ExecuteMCMSProposalV2 would only schedule the batch.

Anyways, if you say that's correct I trust you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think you are still correct, i had the same question before and this is what pablo said

The execute actually calls the timelock contracts scheduleBatch and we still need to call the timelocks execute function so the transfer actually goes on.

so through testing, what it shows is that proposalutils.ExecuteMCMSProposalV2 calls would schedule the batch , marking it as ready and then calling proposalutils.ExecuteMCMSProposalV2 would execute the changeset.

Hope this make sense!

@graham-chainlink graham-chainlink added this pull request to the merge queue Feb 7, 2025
Merged via the queue into develop with commit e6dfb80 Feb 7, 2025
183 of 186 checks passed
@graham-chainlink graham-chainlink deleted the ggoh/DPA-1367/test-helpers branch February 7, 2025 04:19
karen-stepanyan pushed a commit that referenced this pull request Feb 10, 2025
Add equivalent test helpers which use the new MCMS library

Also updated the changeset link transfer to use the new helpers as a way to test the new changes.

JIRA: https://smartcontract-it.atlassian.net/browse/DPA-1367

Co-authored-by: ajaskolski <[email protected]>
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.

4 participants