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

blockstore: Call LedgerColumn methods instead of Database #3650

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

steviez
Copy link

@steviez steviez commented Nov 14, 2024

Problem

#3603 is looking to introduce a change where the rocksdb keys (byte reference) will be stack-allocated instead of heap-allocated. In order to accomplish this, any method that provides a key (ie just about all of them) need to go through the LedgerColumn object since each LedgerColumn has a constant key length that is known at compile time.

On the other hand, the Database functions that operate on a Column take a Column as a generic parameter. Since that function is generic over any column, the key must be heap allocated as we can't know what the key length will be until invocation. So, we need to phase out the Database calls in order to work towards the stack allocated keys.

This PR pulls breaks several commits out of #3603 to keep reviews smaller

Summary of Changes

Use the LedgerColumn objects in Blockstore to perform get() and iter() calls instead of getting it from the Database object directly

@steviez steviez changed the title blockstore: blockstore: Call LedgerColumn methods instead of Database Nov 14, 2024
Copy link

@cpubot cpubot left a comment

Choose a reason for hiding this comment

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

LGTM

@steviez
Copy link
Author

steviez commented Nov 15, 2024

This change is fairly innocuous, so going to push despite not getting several more ship-its; will definitely get more sets of eyes on the more interesting changes

@steviez steviez merged commit 4a1263f into anza-xyz:master Nov 15, 2024
40 checks passed
@steviez steviez deleted the bstore_use_columns branch November 15, 2024 16:41
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