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/receipt migration not working with compact receipt #5828

Merged
merged 14 commits into from
Jun 21, 2023

Conversation

asdacap
Copy link
Contributor

@asdacap asdacap commented Jun 18, 2023

  • Fix receipt migration detection not working. Can detect if encoding is not the right one and initiate receipt migration.
  • Remove tx index if needed according to config.
  • Run receipt migration with multiple thread, took roughly the same amount of time as old receipts sync. Add config to limit concurrency.
  • Compact DB after receipt migration to actually reduce receipt size.
  • Add a flag to force start receipt migration.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

  • Confirm can change config from compact receipt and full receipt and the other way arount.
  • Confirm if receipt is already according to config, it wont start receipt migration.
  • Confirm disk space goes down when moving from full receipt to compact receipt.

Comment on lines +113 to +117
public void Compact()
{
_rocksDb.CompactRange(Keccak.Zero.BytesToArray(), Keccak.MaxValue.BytesToArray(), _columnFamily);
}

Copy link
Member

Choose a reason for hiding this comment

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

Not all db's have Keccaks as keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats true yes. But I figure the range of keccak should overlap most keys.

@asdacap asdacap merged commit 3d1510f into master Jun 21, 2023
61 checks passed
@asdacap asdacap deleted the fix/receipt-migration branch June 21, 2023 13:42
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.

None yet

2 participants