Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Conversation

@patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Jan 11, 2022

closes: #31
closes: #36

@patrick-ogrady patrick-ogrady marked this pull request as draft January 11, 2022 02:52
@patrick-ogrady patrick-ogrady requested a review from gyuho January 11, 2022 05:12
@patrick-ogrady patrick-ogrady marked this pull request as ready for review January 11, 2022 05:12

func GetBlock(db database.KeyValueReader, bid ids.ID) ([]byte, error) {
return db.Get(PrefixBlockKey(bid))
func GetBlock(db database.KeyValueReader, bid ids.ID) (*StatefulBlock, []byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

Preferred() (ids.ID, error)
// Checks the validity of the block.
// Accepted fetches the ID of the last accepted block.
Accepted() (ids.ID, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

+1, better name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually a usage improvement as well...if you build off the preferred, the blockID you are referencing may get orphaned and you'll need to start over.

kvs = append(kvs, KeyValue{
Key: formattedKey,
Value: cursor.Value(),
Value: v,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean now we can return same k-v pairs but with different tx IDs? Should we incude tx id in the response?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess we could return it now that we have it in case people want to know when it was last updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can do this in another PR, however. This is complex enough.

Base automatically changed from check-beneficiary-in-builder to master January 11, 2022 16:05
@patrick-ogrady patrick-ogrady merged commit d2dad43 into master Jan 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Elaborate on Nonce-Less Approach in README Reuse Block Data for Values

3 participants