Skip to content

[Feature]: Submit all blocks possible - #1607

Merged
MSevey merged 7 commits into
evstack:mainfrom
decentrio:nhan/submit_all_blocks_possible
Apr 2, 2024
Merged

MSevey merged 7 commits into
evstack:mainfrom
decentrio:nhan/submit_all_blocks_possible

Conversation

@ThanhNhann

@ThanhNhann ThanhNhann commented Mar 20, 2024

Copy link
Copy Markdown
Contributor

Overview

closes #1590

  • This pr updates the logic of DAClient.SubmitBlocks so now it can submit all blocks possible

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling and messaging for block submission failures due to serialization issues or size limits in the SubmitBlocks method.
  • Tests
    • Updated test cases Test_submitBlocksToDA_BlockMarshalErrorCase1 and Test_submitBlocksToDA_BlockMarshalErrorCase2 to reflect changes in block submission and error messaging.

@coderabbitai

coderabbitai Bot commented Mar 20, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

The recent updates focus on enhancing the block submission logic to the Data Availability (DA) layer by refining error handling and ensuring that valid blocks are submitted even when some blocks encounter marshalling errors. This includes improvements in the SubmitBlocks method for better error messaging and logic to skip problematic blocks, alongside adjustments in test cases to align with these changes.

Changes

File(s) Change Summary
block/manager_test.go Adjusted block numbers and modified block submission logic in test cases for marshalling error cases.
da/da.go, da/da_test.go Updated SubmitBlocks method for enhanced error handling and logic adjustments. Modified assertion messages in tests.

Assessment against linked issues

Objective Addressed Explanation
Improve Block Submission Logic (#1590)
Code Cleanup (#1590)
Implement mechanism to break on marshal error (#1590) The summary mentions improved error handling but lacks specifics on breaking mechanism.

Poem

In the land of code and data streams,
A rabbit hopped, chasing dreams.
🌟 With every leap, a block in place,
Avoiding errors with grace and pace.

"Let valid blocks through," it said with glee,
🚀 For a robust, error-free spree.
In the glow of the moon, it danced around,
Celebrating the code that it had found.

🐰✨

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

@codecov

codecov Bot commented Mar 20, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 76.92308% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 52.19%. Comparing base (c9d8467) to head (1b0810a).
Report is 61 commits behind head on main.

Files Patch % Lines
da/da.go 76.92% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1607      +/-   ##
==========================================
+ Coverage   50.23%   52.19%   +1.95%     
==========================================
  Files          52       52              
  Lines        6762     5635    -1127     
==========================================
- Hits         3397     2941     -456     
+ Misses       3024     2356     -668     
+ Partials      341      338       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coderabbitai coderabbitai Bot left a comment

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.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 553e399 and 7090c50.
Files selected for processing (3)
  • block/manager_test.go (3 hunks)
  • da/da.go (2 hunks)
  • da/da_test.go (1 hunks)
Additional comments: 3
da/da.go (1)
  • 119-149: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [122-188]

The refactoring in the SubmitBlocks method improves error handling and logging for block serialization failures and blob size limits. However, consider adding more detailed comments explaining the logic, especially around the decision to break out of the loop on certain errors. This will enhance maintainability and readability for future contributors.

da/da_test.go (1)
  • 277-277: The updated assertion message correctly reflects the new error handling logic in the SubmitBlocks method. This change ensures that test cases are aligned with the updated functionality.
block/manager_test.go (1)
  • 354-375: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [332-388]

The adjustments to block numbers in the test cases and the modifications related to submitting blocks to the DA layer accurately reflect the updated block submission logic. These changes ensure that the test cases are aligned with the new functionality, enhancing the reliability of the tests.

Comment thread da/da.go Outdated
Comment thread da/da.go
Comment thread block/manager_test.go Outdated

@coderabbitai coderabbitai Bot left a comment

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7090c50 and 3972e46.
Files selected for processing (2)
  • block/manager_test.go (3 hunks)
  • da/da.go (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • block/manager_test.go
  • da/da.go

@MSevey
MSevey self-requested a review March 22, 2024 14:34
Comment thread da/da.go Outdated
Comment thread da/da.go

@MSevey MSevey left a comment

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.

Thanks for the PR!
Some minor edits.

@coderabbitai coderabbitai Bot left a comment

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3972e46 and 1d0993c.
Files selected for processing (1)
  • da/da.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • da/da.go

@ThanhNhann

Copy link
Copy Markdown
Contributor Author

hi @MSevey, can you plz re-run the CI, I think the pr look good now

@MSevey

MSevey commented Mar 26, 2024

Copy link
Copy Markdown
Contributor

hi @MSevey, can you plz re-run the CI, I think the pr look good now

@ThanhNhann the CI ran but it failed. Can you look at the CI logs and see what the failure was?

@MSevey

MSevey commented Mar 26, 2024

Copy link
Copy Markdown
Contributor

hi @MSevey, can you plz re-run the CI, I think the pr look good now

@ThanhNhann the CI ran but it failed. Can you look at the CI logs and see what the failure was?

Looks like a shutdown panic.

https://github.com/rollkit/rollkit/actions/runs/8414991513/job/23039503018#step:4:3421
=== RUN   TestPendingBlocks
    loggers.go:42: Test logs can be found: /tmp/TestPendingBlocks.log1017824086
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1dc3366]

goroutine 17141 [running]:
github.com/rollkit/rollkit/da.(*DAClient).SubmitBlocks(0xc0278a4900, {0x2988288, 0xc027895590}, {0xc0278f7bc0, 0x3, 0x0?}, 0x2800, 0x4511c8?)
	/home/runner/work/rollkit/rollkit/da/da.go:150 +0x726
github.com/rollkit/rollkit/block.(*Manager).submitBlocksToDA(0xc035d70780, {0x2988288, 0xc027895590})
	/home/runner/work/rollkit/rollkit/block/manager.go:901 +0x485
github.com/rollkit/rollkit/block.(*Manager).BlockSubmissionLoop(0xc035d70780, {0x2988288, 0xc027895590})
	/home/runner/work/rollkit/rollkit/block/manager.go:390 +0x1ec
github.com/rollkit/rollkit/node.(*FullNode).OnStart.func2()
	/home/runner/work/rollkit/rollkit/node/full.go:390 +0x89
github.com/rollkit/rollkit/types.(*ThreadManager).Go.func1()
	/home/runner/work/rollkit/rollkit/types/threadmanager.go:26 +0x87
created by github.com/rollkit/rollkit/types.(*ThreadManager).Go in goroutine 16913
	/home/runner/work/rollkit/rollkit/types/threadmanager.go:24 +0xe5
FAIL	github.com/rollkit/rollkit/node	51.883s

Comment thread da/da.go Outdated

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1d0993c and 8c73a64.
Files selected for processing (1)
  • da/da.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • da/da.go
Additional Context Used

@Manav-Aggarwal
Manav-Aggarwal requested a review from MSevey April 1, 2024 21:52
@MSevey
MSevey enabled auto-merge April 2, 2024 13:32
@MSevey
MSevey added this pull request to the merge queue Apr 2, 2024
Merged via the queue into evstack:main with commit 775b781 Apr 2, 2024
@tac0turtle tac0turtle removed this from Evolve Apr 24, 2025
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.

[Feature Request]: Submit all blocks possible

4 participants