-
Notifications
You must be signed in to change notification settings - Fork 33
[Persistence] First Implementation of the StateHash (#284) #285
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
Merged
Merged
Changes from 250 commits
Commits
Show all changes
275 commits
Select commit
Hold shift + click to select a range
1d5486c
Merged with main and resolve conflicts
Olshansk d9a1cf5
Remove test_persistence_state_hash
Olshansk 798ea1f
Removed explicit MaxBlockBytes variable
Olshansk 7cdc008
Update block.go
Olshansk e4a63a8
Fix typo in consensus proto
Olshansk b219468
Updated interface to findHighQC
Olshansk fa3a051
Reverted changes to the utility module to simplify the PR
Olshansk 752992b
Reverted changes to the utility module interface
Olshansk 844688f
Reverted changes to the persistence module interface
Olshansk d5a8a1f
Reverted changes to the persistence module files
Olshansk 6245080
Using GetCodec().Marshal() where appropriate
Olshansk 4672e65
Removed additional persistence related code
Olshansk 5c83fd5
Added initialization flow for AppHash
Olshansk 8c6a923
make develop_test passed
Olshansk 62a51ea
Added call to StoreBlock back
Olshansk 8f61b6f
Avoiding anypb in a few places in the consensus code
Olshansk 1200203
Fixed unit tests
Olshansk 0e03976
Add back stateHash implementation
Olshansk f2777a1
Isolate interface changes only
Olshansk 242565c
Undo more change
Olshansk 55df6cf
Update the interfaces
Olshansk 3dab12f
Merge branch 'main' into issues/249/consensus_techdebt
Olshansk 6370922
Added shouldElectNextLeader
Olshansk 05e0118
Added a comment for getSignableBytes
Olshansk 45da822
Check for nil in CreateProposeMessage
Olshansk 2410521
Revert order of pacemaker defer and telemetry event emitting
Olshansk a478516
s/IdToValAddrMap/idToValAddrMap
Olshansk 8faaf21
s/ValAddrToIdMap/valAddrToIdMap
Olshansk 25971b7
s/NodeId/nodeId
Olshansk 472473c
s/LeaderId/leaderId
Olshansk a5edce5
s/MessagePool/messagePool
Olshansk 28f1ba0
Only a few remaining exported fields in ConsensusModule based on refl…
Olshansk a7207b9
Add TODO in sequence diagram flow
Olshansk a8e5f3d
Added isNodeLockedOnPastQC
Olshansk e39f0f8
Logging error when refreshUtilityContext fails
Olshansk a6990d2
Added shouldLogHotstuffDiscardMessage
Olshansk 8a41361
Added shouldPrepareNewBlock
Olshansk 7493dd3
Added TODO for 256
Olshansk 4ce5792
Merge with main
Olshansk d30fbf5
Merge with main
Olshansk 3f413bd
Added SetUtilityMod and made utilityContext private
Olshansk 317e677
Updated a comment
Olshansk a576229
Merge branch 'main' into issues/249/consensus_techdebt
Olshansk 070ba2a
Added a TODO for 283
Olshansk 9902357
Merge with issues/249/consensus_techdebt
Olshansk 6dafdea
Revert all changes back to main
Olshansk 66bd483
Updated base to main for simplicity
Olshansk 655d5d5
Updated shared changelog
Olshansk 2d864be
Merge with issues/249/consensus_techdebt
Olshansk 9ff0ddb
Checkout main again
Olshansk 0ca02aa
Merge with interface changes
Olshansk aaffb79
Uplied diffs back
Olshansk 342de6a
Temp checkout commit
Olshansk 81837cf
Reapplied all changes from diff
Olshansk 5e8ae53
Merge with interface changes
Olshansk 185919c
another merge
Olshansk f909103
Tests failing but running
Olshansk 593dac7
Commented out the business logic in storeBlock
Olshansk 4f85c49
Merge with interface changes
Olshansk 52ae666
Tests running and mostly passing
Olshansk c795b00
Merge with main
Olshansk 35f1311
Made things work again
Olshansk b984c65
Consensus tests passing again
Olshansk 5530241
Reverted files that shouldn't be part of the interface change
Olshansk ab42525
Cleaning up the interface
Olshansk f9a80ff
make develop_test passed
Olshansk 6ead8ce
Replace data | ok with result, err_code
Olshansk bf27e10
Split and update the sequence diagrams
Olshansk 1e2f758
Merge with interface changes
Olshansk e69456a
Update TODO keyword
Olshansk 67c1cb5
Merge branch 'issues/251/statehash_interface' into issues/284/stateha…
Olshansk 2760dc4
make develop_test passed
Olshansk c35f9db
Things kind of linking together
Olshansk 5171d2d
Almost got a deterministic state hash
Olshansk ffcb91f
Test passed
Olshansk 6317a84
Quick self review
Olshansk eacde91
Resolve merge conflicts
Olshansk 3002911
Update shared/docs/flows/AppHash.md
Olshansk 7ea5969
Update shared/docs/flows/AppHash.md
Olshansk ea2b201
Update shared/docs/flows/AppHash.md
Olshansk 02f2a6b
Remove merge conflict file
Olshansk 68ef680
Update changelog
Olshansk 41c01a7
Minor changelog update
Olshansk 558965c
Added activations and deactivations
Olshansk 1f49dfb
Merge with main
Olshansk 0d5df3a
Fix tests
Olshansk b1a9be1
Merge branch 'main' into issues/251/statehash_interface
Olshansk 4c05a2c
Add call to tx exists
Olshansk 6f97b56
Merge with main
Olshansk 36aee3f
Fix up changelog
Olshansk 8c5f71b
Merge with main - non fully functional
Olshansk 79bba7d
Interim commit
Olshansk 49453fe
Merge branch 'main' into issues/251/statehash_interface
Olshansk a1e9fe7
Merge branch 'issues/251/statehash_interface' into issues/284/stateha…
Olshansk ff0ed30
Merge branch 'main' into issues/251/statehash_interface
Olshansk 5ad8135
Merge branch 'issues/251/statehash_interface' into issues/284/stateha…
Olshansk 843d509
Replied to most comments
Olshansk 27890a5
Tests passing
Olshansk 5c10c72
Merge with issues/251
Olshansk f27bc50
Interim commit while utility tests are failing
Olshansk 244318b
Make test_utility works
Olshansk dabfb0b
Most tests except for persistence pass
Olshansk a68e15e
Merge branch 'main' into issues/251/statehash_interface
Olshansk 979b57c
Merge branch 'issues/251/statehash_interface' into issues/284/stateha…
Olshansk 65cd81a
All tests finally passing except for deterministic hash
Olshansk 6e953a1
Deterministic hash working with TxResult
Olshansk d21d5dc
Finished self review of all the simple code
Olshansk ade27af
Implemented Account trees
Olshansk 1746268
WIP benchmarking
Olshansk 91c2e68
Interim work on benchmarking
Olshansk 158e2b7
Tests pass
Olshansk 26eed85
Add configs & all tests pass
Olshansk 6fb1ab7
Don't clear context
Olshansk 46e050a
Fucking finally printing what's in my trees
Olshansk 2100975
Made some progress on benchmarking
Olshansk 82f0fd4
Exporting state correctly
Olshansk 0d22faa
Added tx indexer
Olshansk a6333d9
Updated db_export_trees
Olshansk dbcb980
Self review upto consensus/block.go
Olshansk 20b71ed
Merge with main
Olshansk 5108240
WIP
Olshansk 4152c14
Unit tests passing
Olshansk 6e0259e
Updated some comments
Olshansk 51e7ebe
Update most of the external interfaces
Olshansk e60e22a
Update comment
Olshansk 51d1401
Self review of most parts of the code
Olshansk 6bf28d5
Small commit
Olshansk d7deb63
First attempt at fixing things
Olshansk 6e3f6c5
Merged with localnet fixes
Olshansk a9de397
Made things kind of work
Olshansk b72173e
Make code easier to understand
Olshansk 8011f8d
Improve logging for p2p
Olshansk d0c68a8
Merge branch 'localnet_fixes' into issues/251/statehash_interface
Olshansk 1686001
Removed persistence/docs/PROTOCOL_STATE_HASH.md from this commit
Olshansk 6b7f556
Almost code random but determinstic test going
Olshansk 3d86e23
Update persistence/module.go
Olshansk 878501c
Update persistence/module.go
Olshansk dd13813
Merge branch 'localnet_fixes' into issues/251/statehash_interface
Olshansk 03c4bc7
Minor release fixes
Olshansk 27f803d
Finally got TestStateHash_RandomButDeterministic to pass
Olshansk ea4fb4a
Merge with main - tests pass but not done yet
Olshansk ccf240e
Minor code cleanup - about to remove SetLatestTxResults
Olshansk 432d55b
Added comments
Olshansk e166e3b
Propogating proper QC in consensus
Olshansk cab5e63
Added QC back to SetProposalBlock
Olshansk a588240
StateHash test passing
Olshansk 23df0cb
Removed export tree related work
Olshansk e3785f3
Moved persistence debug helpers into appropriate file
Olshansk 353d4b0
Halfway through self review
Olshansk 0ebbf52
Reverted unrelated changes
Olshansk 7566bce
Got TestStateHash_ReplayingRandomTransactionsIsDeterministic working
Olshansk 3336af6
Removed unnecessary merkleTreeToProtoSchema
Olshansk 054b93a
make test_persistence passes
Olshansk 60924aa
Merge with main
Olshansk 300c8cb
Merge branch 'issues/251/statehash_interface' into issues/284/stateha…
Olshansk 4dae396
Added TODO for #344R
Olshansk 991fe30
Update persistence/test/benchmark_state_test.go
Olshansk 898f4a7
Update persistence/account.go
Olshansk 05db304
Tend to minor comments
Olshansk f5ca864
Remove height from callRandomDatabaseModifierFunc
Olshansk fa7a392
minor improvements to benchmarking code
Olshansk 3f52358
Updated comments in persistence/HandleDebugMessage
Olshansk bb1069c
Append to nil slice
Olshansk 4f9f87d
Update persistence/debug.go
Olshansk e442648
Update persistence/state.go
Olshansk 4b86e6f
Remove unused height var when getting all accounts updated
Olshansk c353335
Removed unnecessary height param
Olshansk 4ec2421
Added txsOrderInBlockHashDescending constant
Olshansk ca658f0
A few minor edits
Olshansk 85078f3
Updated documentation for ComputeAppHash
Olshansk 10c1acb
Merge branch 'main' into issues/251/statehash_interface
Olshansk b48e6e1
Merge with issues/251
Olshansk 25439db
Added db_cli_node
Olshansk 4e81e6a
Update utility/block.go
Olshansk e7c3455
Added unit tests for GetPoolsUpdated and GetAccountsUpdated
Olshansk 8a9b130
Proper implementation of GetPrevHash
Olshansk 93b94b1
Removed GetBlockHash
Olshansk f3164af
Update comment
Olshansk d0dc9c1
Minor code cleanup throughout
Olshansk 741949f
Added TODO for #346
Olshansk e10b147
Consensus fixes
Olshansk b4e8007
Update shared/docs/PROTOCOL_STATE_HASH.md
Olshansk e413576
[Utility] Local Proof of Stake CLI - RPC server [part 2/2] - Issue #…
deblasis 14c2ae3
[Utility] Local Proof of Stake CLI - Issue #112 (#169)
deblasis 92897bf
Updated txResults comment
Olshansk 0551bbc
Ticket #211: finding unnecessary public functions in the Persistence …
Jasonyou1995 131d08f
Remove unnecessary critical sections
Olshansk bc92358
Minor updates in documentation
Olshansk 53e7dfc
Removed Latest from function names
Olshansk 1afbc78
Updating references documents
Olshansk 7e93272
Replace true | false with just false to simplify diagram
Olshansk ad042ba
Merge with main
Olshansk c1f5151
Updated the consensus changelog
Olshansk 00c5378
Updated the persistence changelog
Olshansk 6c41701
Fix numbering in the README
Olshansk 8353e70
Updated shared/modules changelog
Olshansk 4564c32
Updated utility changelog
Olshansk 9ce3f4f
Merged with main
Olshansk d1f8086
Merge with issues/251
Olshansk c134b82
Added a weird bug related to errors in the non main thread
Olshansk 9ff13ea
Updated the consensus changelog
Olshansk 5468ccf
self review + test for TestGetValidatorUpdateAtHeigh
Olshansk 069084c
Added unit tests for all the actor retriverals
Olshansk 609c47f
Fixed ShowLatestBlockInStore
Olshansk dcb99e8
Temp changes
Olshansk 5aa5ef5
Merge with main
Olshansk aca2b23
Improve diagram for high vs locked QC
Olshansk 8b81f28
Merge with main and tests are passing
Olshansk f72aae7
Merge branch 'main' into issues/251/statehash_interface
Olshansk 0aedd43
Merge with main and tests are passing
Olshansk e7f624e
Olshansky self-review; round 3
Olshansk f23651d
Update persistence/docs/PROTOCOL_STATE_HASH.md
Olshansk 2d4717b
Rename finalQC to commitQC
Olshansk 55a12ba
Merge branch 'issues/251/statehash_interface' into issues/284/stateha…
Olshansk 365abe1
Merge branch 'main' into issues/284/statehash_impl
Olshansk 9bdadb0
Import fix
Olshansk 4225cee
Documentation clarifications per code review
Olshansk 1943737
Try fixing CleanupTest for remote tests
Olshansk 1e382c6
Do not merge this - testing workflow
Olshansk cc362e4
Update make test_all_with_coverage
Olshansk f959553
Test all TestUtilityContext
Olshansk fcd54ff
Fix temporary test_all_with_coverage
Olshansk e3f32a0
Only test TestUtilityContext_HandleMessage
Olshansk bc36d30
Added IMPROVE
Olshansk f7065bc
Update expiration to 20 mins
Olshansk 1953ad4
Don't run fisherman tests
Olshansk 5a22570
Cleanup whitespace while inspecting tests
Olshansk 14ee5b1
Only keep 1 actor type in utility tests
Olshansk dbd2a90
Add back service node during testing
Olshansk f56a10a
Adding back the validator
Olshansk 2eea86b
[Quick CI change] Run tests once (#365)
okdas 7a732d3
Add back fisherman tests
Olshansk 7422aa5
Fisherman tests only
Olshansk 7dbc3bc
make test_all_with_json_coverage
Olshansk c7eba2d
Alternative method to loading genesis state
Olshansk ec05e05
Remove TestUtilityContext_HandleMessage
Olshansk efe028e
Merge with main and tests are passing
Olshansk 6742174
Revert makefile use in workflow
Olshansk bfc30db
Update main.yml
okdas 8c93f56
Merge pull request #367 from pokt-network/build-images-main-only
okdas a8ff143
Fix comment
Olshansk a211022
Only 2 protocol actors being tested
Olshansk dbb8c18
Update main.yml
Olshansk a2d401d
Test TestUtilityContext remote
Olshansk 30b1156
Trying out this solution: https://stackoverflow.com/a/73561510/768439
Olshansk d9fbe74
Update main.yml
okdas 97d4fda
Update main.yml
okdas 7da547b
Only create one persistence mod in all utility tests
Olshansk 00986d0
Run :all_the_tests:
Olshansk 5df8756
Removing shitty code
Olshansk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,27 +50,41 @@ jobs: | |
| run: make install_cli_deps | ||
| - name: generate protobufs, RPC server, RPC client and mocks | ||
| run: make protogen_local && make mockgen && make generate_rpc_openapi | ||
| - name: run all tests | ||
| run: make test_all_with_json | ||
| - name: Create coverage report and run tests | ||
| # Not utilizing makefile target here to make use of pipefail bash feature. | ||
| run: | | ||
| set -euo pipefail | ||
| make test_all_with_json_coverage | ||
| - name: Output test failures | ||
| # Makes it easier to find failed tests so no need to scroll through the whole log. | ||
| if: ${{ failure() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
| run: cat test_results.json | jq 'select(.Action == "fail")' | ||
| - name: Upload test results | ||
| if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: test-results | ||
| path: | | ||
| test_results.json | ||
| - name: Annotate tests on GitHub | ||
| # Only annotate if the test failed on target version to avoid duplicated annotations on GitHub. | ||
| if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
| uses: guyarb/[email protected] | ||
| with: | ||
| test-results: test_results.json | ||
| - name: Prepare code coverage report | ||
| if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
| run: go tool cover -func=coverage.out -o=coverage.out | ||
| - name: Upload coverage to Codecov | ||
| if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
| uses: codecov/codecov-action@v3 | ||
| - name: Run golangci-lint | ||
| # Only run if the test failed on target version to avoid duplicated annotations on GitHub. | ||
| if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
| uses: golangci/golangci-lint-action@v3 | ||
| with: | ||
| # only-new-issues: true | ||
| args: --issues-exit-code=0 # TODO: Remove this once we fix all the issues. | ||
| - name: create coverage report | ||
| if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
| run: make test_all_with_coverage | ||
| - name: Upload coverage to Codecov | ||
| if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
| uses: codecov/codecov-action@v3 | ||
|
|
||
| # TODO(@okdas): reuse artifacts built by the previous job instead | ||
| # of going through the build process in container build job again | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| SELECT schema_name FROM information_schema.schemata; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.