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

Fix Testnet start #1725

Merged
merged 1 commit into from
Dec 27, 2023
Merged

Fix Testnet start #1725

merged 1 commit into from
Dec 27, 2023

Conversation

otherview
Copy link
Contributor

Why this change is needed

https://github.com/ten-protocol/ten-internal/issues/2654

Testnet fails to start after deploying dev testnet twice.
Seems to be related with the revert state, commenting it out for now.

What changes were made as part of this PR

Please provide a high level list of the changes made

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

Copy link

coderabbitai bot commented Dec 27, 2023

Walkthrough

The code update involves disabling a feature related to the management of database state snapshots within a batch execution component. A line of code that created a snapshot of the database state has been commented out, and a note has been added to address a future fix regarding deployment issues caused by unintended mutations to the database.

Changes

File Path Change Summary
.../components/batch_executor.go Disabled snapshot creation and added a TODO for fixing deployment issues related to stateDB mutations.

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 with CodeRabbit Bot (@coderabbitai)

  • You can directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • You can tag CodeRabbit on specific lines of code or entire files in the PR by tagging @coderabbitai in a comment. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase. Examples:
    • @coderabbitai generate interesting stats about this repository.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid.
    • @coderabbitai read the files in the src/scheduler package and generate 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.

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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@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.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 33d59d1 and 400912f.
Files selected for processing (1)
  • go/enclave/components/batch_executor.go (2 hunks)

@@ -172,7 +172,7 @@ func (executor *batchExecutor) ComputeBatch(context *BatchExecutionContext, fail
if err != nil {
return nil, fmt.Errorf("could not create stateDB. Cause: %w", err)
}
snap := stateDB.Snapshot()
// snap := stateDB.Snapshot()
Copy link

Choose a reason for hiding this comment

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

Commented out code can lead to confusion and should be accompanied by a clear explanation or a linked issue for context.

- // snap := stateDB.Snapshot()
+ // TODO: Re-enable stateDB.Snapshot() once issue #2654 is resolved.

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
// snap := stateDB.Snapshot()
// TODO: Re-enable stateDB.Snapshot() once issue #2654 is resolved.

stateDB.RevertToSnapshot(snap)
// todo review why this is failing deployment with "panic: revision id 0 cannot be reverted" - https://github.com/ten-protocol/ten-internal/issues/2654
//// revert any unexpected mutation to the statedb
//stateDB.RevertToSnapshot(snap)
Copy link

Choose a reason for hiding this comment

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

Disabling the revert state functionality may have implications for the state consistency. Ensure that the risks are understood and that there is a plan to re-enable this functionality.

- //stateDB.RevertToSnapshot(snap)
+ // FIXME: Re-enable stateDB.RevertToSnapshot(snap) once the underlying issue is resolved.

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
//stateDB.RevertToSnapshot(snap)
// FIXME: Re-enable stateDB.RevertToSnapshot(snap) once the underlying issue is resolved.

@@ -222,8 +222,9 @@
len(crossChainTransactions) == 0 &&
len(messages) == 0 &&
len(transfers) == 0 {
// revert any unexpected mutation to the statedb
stateDB.RevertToSnapshot(snap)
// todo review why this is failing deployment with "panic: revision id 0 cannot be reverted" - https://github.com/ten-protocol/ten-internal/issues/2654
Copy link

Choose a reason for hiding this comment

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

The comment regarding the deployment failure should include a reference to the issue tracker for easier follow-up.

+ // TODO: Review the cause of "panic: revision id 0 cannot be reverted" and resolve it according to issue #2654.

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
// todo review why this is failing deployment with "panic: revision id 0 cannot be reverted" - https://github.com/ten-protocol/ten-internal/issues/2654
// TODO: Review the cause of "panic: revision id 0 cannot be reverted" and resolve it according to issue #2654.

@otherview otherview merged commit b6444cf into main Dec 27, 2023
10 checks passed
@otherview otherview deleted the pedro/testnet_fails_to_start branch December 27, 2023 17:48
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