Skip to content

add timelock executor interface + evm implementation#210

Merged
akhilchainani merged 12 commits into
mainfrom
feat/timelock-execution
Jan 3, 2025
Merged

add timelock executor interface + evm implementation#210
akhilchainani merged 12 commits into
mainfrom
feat/timelock-execution

Conversation

@akhilchainani

@akhilchainani akhilchainani commented Jan 2, 2025

Copy link
Copy Markdown
Contributor

Below is a summarization created by an LLM (gpt-4o-2024-08-06). Be mindful of hallucinations and verify accuracy.

Why

Implementing a timelock executor interface and its EVM implementation enhances the system's ability to manage scheduled operations on EVM chains. This addition provides a structured approach to execute batch operations with timelock contracts, improving the system's functionality and reliability.

What

  • .changeset/smooth-camels-suffer.md
    • Implement timelock executor interface + EVM implementation
  • timelock_executor.go
    • Define TimelockExecutor interface
    • Add Execute method for scheduled operations
  • evm/timelock_executor.go
    • Implement TimelockExecutor for EVM chains
    • Add NewTimelockExecutor constructor
    • Implement Execute method for batch operations
  • evm/timelock_executor_test.go
    • Add tests for NewTimelockExecutor
    • Add tests for Execute method
  • mocks/timelock_executor.go
    • Generate mock for TimelockExecutor
    • Add Execute method mock implementation

@changeset-bot

changeset-bot Bot commented Jan 2, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b0cb6df

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smartcontractkit/mcms Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@akhilchainani akhilchainani marked this pull request as ready for review January 2, 2025 23:05
@akhilchainani akhilchainani requested a review from a team as a code owner January 2, 2025 23:05
return "", err
}

calls := make([]bindings.RBACTimelockCall, len(bop.Transactions))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nitpick: You probably want this and we save a bunch of initialisations

Suggested change
calls := make([]bindings.RBACTimelockCall, len(bop.Transactions))
calls := make([]bindings.RBACTimelockCall, 0, len(bop.Transactions))

Why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hm actually, I made this change and it caused tests to start failing with index out of bound

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you'd need to change the calls[i] = bellow to calls = append(calls, ...).

It's a minor thing though. Let's proceed as is.

Comment thread sdk/timelock_executor.go

// TimelockExecutor is an interface for executing scheduled timelock operations.
type TimelockExecutor interface {
Execute(bop types.BatchOperation, timelockAddress string, predecessor common.Hash, salt common.Hash) (string, error)

@graham-chainlink graham-chainlink Jan 3, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i wonder would the import from "github.com/ethereum/go-ethereum/common" for Hash would cause any issue once we start supporting solana for mcms?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, because its just a [32]byte array, which is the output of any keccack256 hash function which is a prerequisite to supporting MCMS on any chain

@cl-sonarqube-production

Copy link
Copy Markdown

@akhilchainani akhilchainani requested a review from a team January 3, 2025 15:47
@akhilchainani akhilchainani added this pull request to the merge queue Jan 3, 2025
Merged via the queue into main with commit 8431019 Jan 3, 2025
@akhilchainani akhilchainani deleted the feat/timelock-execution branch January 3, 2025 15:56
ecPablo pushed a commit that referenced this pull request Jan 8, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @smartcontractkit/mcms@0.5.0

### Minor Changes

- [#214](#214)
[`04cb547`](04cb547)
Thanks [@akhilchainani](https://github.com/akhilchainani)! - Add helper
function for timelock proposal execution

- [#210](#210)
[`8431019`](8431019)
Thanks [@akhilchainani](https://github.com/akhilchainani)! - Implement
timelock executor interface + EVM implementation

Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
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.

3 participants