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

Boonet: fixed Bera token produced at Genesis #2161

Merged
merged 9 commits into from
Nov 20, 2024
Merged

Boonet: fixed Bera token produced at Genesis #2161

merged 9 commits into from
Nov 20, 2024

Conversation

calbera
Copy link
Contributor

@calbera calbera commented Nov 20, 2024

Upon Boonet release, an error made in eth genesis where the number of EVM tokens specified is orders of magnitude smaller than the required one.
This PR carries out an emergency fix for it: a specific height is selected (based on Boonet network) where a one time minting of the required number of EVM tokens is carried out, using withdrawals (similar logic to #2158)

Summary by CodeRabbit

  • New Features

    • Introduced constants for EVM token minting, enhancing the withdrawal process to handle specific minting cases.
  • Bug Fixes

    • Improved error handling in withdrawal processing to ensure better clarity and consistency.
  • Refactor

    • Updated function signatures to improve data handling and processing logic across various methods related to state processing.

Copy link
Contributor

coderabbitai bot commented Nov 20, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The changes in this pull request involve modifications to several files within the state-transition and components packages. Notably, the ProvideDispatcher function's formatting was updated for clarity, while constants for EVM token minting were introduced in the statedb.go file. Additionally, the ProcessBlock and processWithdrawals methods were adjusted to enhance error handling and refine data processing, particularly concerning EVM minting. Overall, these updates focus on improving code clarity and control flow without introducing new functionalities.

Changes

File Path Change Summary
mod/node-core/pkg/components/dispatcher.go Reformatted dp.WithEvent call for async.FinalBeaconBlockReceived to a multi-line argument without affecting functionality.
mod/state-transition/pkg/core/state/statedb.go Added constants: EVMMintingSlot, EVMMintingAddress, EVMMintingAmount. Modified ExpectedWithdrawals method to handle EVM minting by checking EVMMintingSlot. Updated nolint directive for linting rules.
mod/state-transition/pkg/core/state_processor.go Updated ProcessBlock method to pass blk instead of blk.GetBody(). Enhanced error handling in ProcessSlots method. Refined processSlot method to ensure state integrity during updates.
mod/state-transition/pkg/core/state_processor_staking.go Updated processWithdrawals method to pass blk instead of body. Added conditional check for EVMMintingSlot and improved error handling for mismatched withdrawal lengths.

Possibly related PRs

Suggested labels

Ready for Review, Merge me daddy

Suggested reviewers

  • itsdevbear
  • ocnc
  • nidhi-singh02

Poem

🐇 In the code where bunnies play,
Changes hop in a bright array.
Minting tokens, a new slot found,
With every line, our joy is bound!
Process flows with care and grace,
In our code, a happy place! 🌼


🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 11.11111% with 24 lines in your changes missing coverage. Please review.

Project coverage is 26.34%. Comparing base (b23f942) to head (950dd9d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
mod/state-transition/pkg/core/state/statedb.go 0.00% 9 Missing and 1 partial ⚠️
...ate-transition/pkg/core/state_processor_staking.go 23.07% 9 Missing and 1 partial ⚠️
mod/node-core/pkg/components/dispatcher.go 0.00% 3 Missing ⚠️
mod/state-transition/pkg/core/state_processor.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2161      +/-   ##
==========================================
- Coverage   26.37%   26.34%   -0.03%     
==========================================
  Files         361      361              
  Lines       16272    16297      +25     
  Branches       12       12              
==========================================
+ Hits         4291     4294       +3     
- Misses      11712    11732      +20     
- Partials      269      271       +2     
Files with missing lines Coverage Δ
mod/state-transition/pkg/core/state_processor.go 26.69% <0.00%> (ø)
mod/node-core/pkg/components/dispatcher.go 0.00% <0.00%> (ø)
mod/state-transition/pkg/core/state/statedb.go 40.16% <0.00%> (-1.72%) ⬇️
...ate-transition/pkg/core/state_processor_staking.go 52.73% <23.07%> (-2.06%) ⬇️
---- 🚨 Try these New Features:

@calbera calbera changed the title fix minting test minting evm inflation Nov 20, 2024
@abi87 abi87 changed the title test minting evm inflation Boonet: fixed Bera token produced at Genesis Nov 20, 2024
@abi87 abi87 marked this pull request as ready for review November 20, 2024 18:19
@abi87 abi87 merged commit cafd14e into main Nov 20, 2024
16 checks passed
@abi87 abi87 deleted the mintmint branch November 20, 2024 18:31
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.

2 participants