Skip to content

Conversation

@quantumagi
Copy link
Contributor

@quantumagi quantumagi commented Jul 11, 2022

This PR leads to an overall code reduction by avoiding duplicate implementations of e.g. the Coin database. The advantage is:

The abstraction interface (IDb, IDbBatch and IDBIterator) adds other nice things such as:

  • expecting keys to be specified as separate table and key identifiers.
  • expecting iterators to be constrained to operate within single tables.

This has been split off PR #995 to make that PR easier to review.

@quantumagi quantumagi requested a review from noescape00 July 11, 2022 07:49
@quantumagi quantumagi requested review from zeptin and removed request for noescape00 July 11, 2022 11:03
this.iterator.Seek(new[] { this.table }.Concat(key).ToArray());
}

public void SeekToLast()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you give a high-level description of how this method works? It is not entirely intuitive to me how seeking based on a single-byte table identifier gives the last record. Is it the last record within the current table? I presume it has something to do with how records are arranged below the table identifiers.

@quantumagi quantumagi merged commit 69d48e7 into stratisproject:release/1.4.0.0 Jul 12, 2022
quantumagi added a commit to quantumagi/StratisFullNode-1 that referenced this pull request Jan 30, 2023
* Merge CoinDb implementations

* Reduce changes

* Update db variable name

* Update db variable name

* Add comments to SeekToLast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants