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

feat(validator): implement validator client and fix actions test #288

Merged

Conversation

sm-stack
Copy link
Contributor

@sm-stack sm-stack commented Apr 2, 2024

Description

Implemented handling logics at kroma-validator client, and fixed the relevant actions test at op-e2e. Adding the commands for validators and system test for the new validator client will be handled with the following PRs.

For proper testing, GovernanceToken is changed. Ownable at GovernanceToken is temporarily removed to allow minting the tokens inside the test code and check the behavior of validator client, after the successful transition to new validator system. This must be fixed after PR #269 is merged.

Also, this PR includes an addition of flags that is needed to run devnet.

This PR must be merged after PR #269 and #277 are merged into dev.

@sm-stack sm-stack requested a review from a team as a code owner April 2, 2024 08:41
Copy link
Contributor

coderabbitai bot commented Apr 2, 2024

Important

Auto Review Skipped

Auto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The recent updates focus on enhancing the functionality and interaction of validator contracts within the Kroma ecosystem. Key changes include the introduction of new initialization functions, modifications to contract deployment and management, and updates to testing and configuration settings. Notably, the governance token's structure was altered by removing inheritance traits and updating permissions, which aligns with broader changes in contract management and challenge creation capabilities.

Changes

File Path Changes
kroma-bindings/bindings/... Added init() functions and new variables across multiple bindings for better initialization and data handling.
kroma-chain-ops/genesis/config.go Removed _owner field for GovernanceToken in configuration function.
kroma-validator/... Enhanced validator functionalities with new fields, updated contract interactions, and added logic for challenge management.
op-e2e/actions/... Updated validator and challenger actions and tests to align with new contract functionalities.
packages/contracts/contracts/governance/GovernanceToken.sol
packages/contracts/contracts/test/GovernanceToken.t.sol
Updated governance token functionalities and test assertions; removed Ownable inheritance.
packages/contracts/deploy/L1/... Updated deployment scripts for GovernanceToken and related proxies, reflecting new contract structures and address handling.
packages/contracts/.gas-snapshot Optimized gas costs for contract tests.

This table summarizes the extensive updates made across different components of the Kroma platform, focusing on improving contract interactions, testing, and deployment strategies.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@seolaoh seolaoh changed the base branch from feat/implement-validator-system-v2 to feat/implement-validator-manager April 8, 2024 03:53
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

kroma-bindings/bindings/assetmanager_more.go Outdated Show resolved Hide resolved
kroma-bindings/bindings/validatormanager_more.go Outdated Show resolved Hide resolved
kroma-bindings/bindings/l2outputoracle_more.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
@sm-stack sm-stack self-assigned this Apr 11, 2024
@sm-stack sm-stack requested a review from a team as a code owner April 17, 2024 09:19
@sm-stack sm-stack force-pushed the feat/implement-validator-client branch from 340e463 to 07ef6fd Compare April 18, 2024 03:59
@seolaoh seolaoh force-pushed the feat/implement-validator-manager branch 2 times, most recently from 9795ebe to a0f5571 Compare April 18, 2024 05:57
@sm-stack sm-stack force-pushed the feat/implement-validator-client branch 3 times, most recently from 26b4f56 to 453aeeb Compare April 18, 2024 15:45
Base automatically changed from feat/implement-validator-manager to feat/implement-validator-system-v2 April 19, 2024 08:01
@sm-stack sm-stack force-pushed the feat/implement-validator-client branch from 453aeeb to b97ee89 Compare April 19, 2024 08:37
@sm-stack
Copy link
Contributor Author

Added a commit that updates isValManagerEnabled flag in a real-time manner by subscribing to output submission event.

@sm-stack sm-stack marked this pull request as draft April 22, 2024 08:56
@sm-stack sm-stack force-pushed the feat/implement-validator-client branch from 9f98e21 to 5544e3f Compare April 22, 2024 14:00
@sm-stack sm-stack changed the base branch from feat/implement-validator-system-v2 to feat/upgrade-validator-system-colosseum April 22, 2024 14:00
@sm-stack sm-stack marked this pull request as ready for review April 23, 2024 01:51
@seolaoh seolaoh force-pushed the feat/upgrade-validator-system-colosseum branch from bc2a2d8 to 1392622 Compare April 23, 2024 05:28
kroma-validator/validator/status.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/config.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/validator/status.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
@sm-stack sm-stack force-pushed the feat/implement-validator-client branch 2 times, most recently from bc59abe to d459839 Compare April 24, 2024 02:27
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
@seolaoh seolaoh force-pushed the feat/upgrade-validator-system-colosseum branch from 1392622 to 10be0bf Compare April 24, 2024 05:33
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
@sm-stack sm-stack force-pushed the feat/implement-validator-client branch 2 times, most recently from b0db29f to 944d68b Compare April 25, 2024 08:28
kroma-chain-ops/genesis/layer_one.go Outdated Show resolved Hide resolved
kroma-chain-ops/genesis/layer_one.go Outdated Show resolved Hide resolved
op-e2e/actions/l2_challenger.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Show resolved Hide resolved
op-e2e/actions/l2_validator_test.go Outdated Show resolved Hide resolved
op-e2e/actions/l2_validator_test.go Outdated Show resolved Hide resolved
op-e2e/actions/l2_validator_test.go Show resolved Hide resolved
op-e2e/actions/l2_validator_test.go Outdated Show resolved Hide resolved
op-e2e/actions/l2_validator_test.go Show resolved Hide resolved
op-e2e/actions/l2_validator_test.go Outdated Show resolved Hide resolved
@seolaoh seolaoh force-pushed the feat/upgrade-validator-system-colosseum branch from 10be0bf to e3c1b38 Compare April 26, 2024 00:45
@sm-stack sm-stack force-pushed the feat/implement-validator-client branch from 944d68b to f2c08a0 Compare April 26, 2024 02:39
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/l2_output_submitter.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Outdated Show resolved Hide resolved
kroma-validator/challenger.go Show resolved Hide resolved
kroma-validator/challenger.go Show resolved Hide resolved
@sm-stack sm-stack force-pushed the feat/implement-validator-client branch from f2c08a0 to c0adc23 Compare April 26, 2024 04:49
kroma-validator/challenger.go Outdated Show resolved Hide resolved
op-e2e/actions/l2_validator.go Show resolved Hide resolved
op-e2e/actions/l2_validator_test.go Outdated Show resolved Hide resolved
op-e2e/actions/l2_validator_test.go Outdated Show resolved Hide resolved
op-e2e/actions/l2_validator.go Outdated Show resolved Hide resolved
op-e2e/actions/l2_validator_test.go Outdated Show resolved Hide resolved
op-e2e/actions/l2_validator_test.go Outdated Show resolved Hide resolved
@sm-stack sm-stack force-pushed the feat/implement-validator-client branch from c0adc23 to 5931c37 Compare April 26, 2024 07:40
Copy link
Contributor

@seolaoh seolaoh left a comment

Choose a reason for hiding this comment

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

LGTM

@sm-stack sm-stack force-pushed the feat/implement-validator-client branch from 5931c37 to 07dd2b2 Compare April 26, 2024 09:37
Copy link
Contributor

@0xHansLee 0xHansLee left a comment

Choose a reason for hiding this comment

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

LGTM

@sm-stack sm-stack force-pushed the feat/implement-validator-client branch 2 times, most recently from 7942dad to b9bec16 Compare April 26, 2024 13:14
@sm-stack
Copy link
Contributor Author

@0xHansLee I restored two of changes regarding your feedbacks (link 1 & 2), since I think they are duplicates for the below return statements at L#332 & L#654.

Copy link
Contributor

@Pangssu Pangssu left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from feat/upgrade-validator-system-colosseum to feat/implement-validator-system-v2 April 29, 2024 07:33
@sm-stack sm-stack force-pushed the feat/implement-validator-client branch from b9bec16 to 6c80279 Compare April 29, 2024 07:39
@0xHansLee 0xHansLee merged commit 8169f41 into feat/implement-validator-system-v2 Apr 29, 2024
2 checks passed
@0xHansLee 0xHansLee deleted the feat/implement-validator-client branch April 29, 2024 08:16
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