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

Add fork resolution algorithm to the library #19

Merged
merged 2 commits into from
Dec 13, 2022

Conversation

sgerbino
Copy link
Member

@sgerbino sgerbino commented Dec 13, 2022

Resolves #18.

Brief description

Adds enum class fork_resolution_algorithm and an overloaded open() function that accepts it as parameter and translate it to a comparator function.

Checklist

  • I have built this pull request locally
  • I have ran the unit tests locally
  • I have manually tested this pull request
  • I have reviewed my pull request
  • I have added any relevant tests

Demonstration

./tests/Debug/koinos_state_db_tests -l message
Running 13 test cases...
Creating object
Modifying object
Erasing object
Basic fork tests on state_db
Test commit
Test discard
Check duplicate node creation
Check failed linking
Test minority fork
Creating object on transient state node
Closing and opening database
Creating object on committed state node
Closing and opening database
Resetting database
Creating object
Creating anonymous state node
Modifying object
Deleting anonymous node
Creating anonymous state node
Modifying object
Committing anonymous node
Test default FIFO fork resolution
Test block time fork resolution
Test pob fork resolution
Checking persistence when backed by rocksdb
Checking transience when backed by std::map
Check clone of un-finalized node
Checking clone of a finalized node

*** No errors detected

@sgerbino sgerbino merged commit 2793f6c into master Dec 13, 2022
@sgerbino sgerbino deleted the 18-fork-resolution-algorithm branch December 13, 2022 19:43
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.

[FEATURE]: Define fork resolution algorithm and accept them as parameters to open
2 participants