Skip to content

Conversation

@i-m-aditya
Copy link
Contributor

@i-m-aditya i-m-aditya commented Jun 4, 2025

fixing: #16586
This PR refactors the handling of the HeaderTerminalDifficulties table to align with our post Paris/Merge policy. Key changes include:

  • Removed Pruning: Eliminated the pruning operation for HeaderTerminalDifficulties in the database, as the table is now read-only.
  • Updated Tests: Adjusted test assertions to no longer check the length of HeaderTerminalDifficulties in the database.
  • Documentation: Updated relevant documentation to clarify the table's read-only status in the database while still being written to static files for historical data.
  • Code Cleanup: Removed unnecessary operations and added comments to explain the changes.

@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Jun 4, 2025
@mattsse mattsse added the A-db Related to the database label Jun 4, 2025
Aditya Pandey added 2 commits June 5, 2025 21:24
@i-m-aditya i-m-aditya force-pushed the feat/drop-support-for-difficulty-table branch from 6103eae to 7d41def Compare June 7, 2025 04:13
@i-m-aditya i-m-aditya marked this pull request as ready for review June 7, 2025 07:59
Action::InsertCanonicalHeaders => self.insert_canonical_headers.record(duration),
Action::InsertHeaders => self.insert_headers.record(duration),
Action::InsertHeaderNumbers => self.insert_header_numbers.record(duration),
#[expect(deprecated)]
Copy link
Contributor

Choose a reason for hiding this comment

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

The #[expect(deprecated)] attribute is incorrect here - it should be #[allow(deprecated)] to properly suppress the deprecation warning. The expect attribute is used for different purposes in Rust (typically with #[expect(clippy::lint_name)] to acknowledge a clippy lint).

Suggested change
#[expect(deprecated)]
#[allow(deprecated)]

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

@i-m-aditya
Copy link
Contributor Author

@mattsse quick follow-up on this — would love your input!

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this is great!

taking this for a spin, changes all look good.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

okay, I realized we need to do a few more things first

} else {
tx.put::<tables::CanonicalHeaders>(header.number, header.hash())?;
tx.put::<tables::HeaderTerminalDifficulties>(header.number, td.into())?;
// Note: HeaderTerminalDifficulties table is read-only in database after
Copy link
Collaborator

Choose a reason for hiding this comment

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

for future prs,

these docs are totally meaningless because the code doesnt have any references to HeaderTerminalDifficulties so after this is merged this note will just be confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mattsse Could you clarify how this approach would work if we attempt to backfill post-merge ranges from the live DB? Wouldn’t we encounter missing HTD values, given we don’t store them anymore post-merge?

@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Jul 22, 2025
@github-actions github-actions bot closed this Jul 29, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Reth Tracker Jul 29, 2025
@mattsse mattsse reopened this Jul 30, 2025
@github-project-automation github-project-automation bot moved this from Done to In Progress in Reth Tracker Jul 30, 2025
@mattsse mattsse added M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity and removed S-stale This issue/PR is stale and will close with no further activity labels Jul 30, 2025
@mattsse
Copy link
Collaborator

mattsse commented Jul 30, 2025

reopened this because this is still planned but still blocked

@mattsse
Copy link
Collaborator

mattsse commented Oct 21, 2025

superseded by #19151

very sorry about this @i-m-aditya

@mattsse mattsse closed this Oct 21, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Oct 21, 2025
@mattsse
Copy link
Collaborator

mattsse commented Oct 21, 2025

actually @joshieDo we still need something from here

@mattsse mattsse reopened this Oct 21, 2025
@github-project-automation github-project-automation bot moved this from Done to In Progress in Reth Tracker Oct 21, 2025
@joshieDo joshieDo added this pull request to the merge queue Oct 21, 2025
@joshieDo
Copy link
Collaborator

ty @i-m-aditya !

Merged via the queue into paradigmxyz:main with commit 563ae0d Oct 21, 2025
43 of 45 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-db Related to the database M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants