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

GRPH-90 Fix for history ID mismatch issue #117

Merged
merged 1 commit into from
Sep 9, 2019
Merged

Conversation

ronakpatel3110
Copy link

A node with track-account configured has bigger history_object_id's (1.11.x) than nodes with default configuration values.

The problem was caused by using of use_next_id().

When creating new objects, old_index_next_ids will be updated in on_create(), when undoing, the value will be reverted to saved old id.

But in history plugin we didn't save old ids in old_index_next_ids, thus no reversion will be done when undoing.

Bitshares PR: bitshares/bitshares-core#875

@bobinson
Copy link

bobinson commented Sep 8, 2019

@ronakpatel3110 - Please provide the steps to verify this PR.

@bobinson bobinson added the Changes Requested Changes Requested via review label Sep 8, 2019
@bobinson
Copy link

bobinson commented Sep 9, 2019

@ronakpatel3110 - Can you think of specific steps for the QA team to verify this PR ?

@bobinson bobinson self-requested a review September 9, 2019 13:42
@bobinson
Copy link

bobinson commented Sep 9, 2019

Testcases:
./tests/chain_test -t acccount_history_tests

The testing steps involves undoing a block which is difficult/impossible for QA to do without touching the code.

QA can run below test cases to confirm this change is working:

./tests/chain_test -t account_history_tests/track_account
./tests/chain_test -t account_history_tests/track_account2

Copy link

@bobinson bobinson left a comment

Choose a reason for hiding this comment

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

LGTM

@bobinson bobinson added ready2merge PRs reviewed and ready for merge, but not merged due to HF or other dependencies and removed Changes Requested Changes Requested via review labels Sep 9, 2019
@ronakpatel3110
Copy link
Author

The testing steps involves undoing a block which is difficult/impossible for QA to do without touching the code.

QA can run below test cases and observe the same output to confirm this change is working:

pbsa07@pbsa08:~/src/peerplays$ ./tests/chain_test -t account_history_tests/track_account
Random number generator seeded to 1568038932
GRAPHENE_TESTING_GENESIS_TIMESTAMP is 1431700002
Running 1 test case...
1332423ms th_a       object_database.cpp:94        open                 ] Opening object database from /tmp/graphene-tmp/e244-2b1c-5ad6-74c3 ...
1332424ms th_a       object_database.cpp:100       open                 ] Done opening object database.
1332429ms th_a       bookie_plugin.cpp:469         plugin_initialize    ] bookie plugin: plugin_startup() begin
1332429ms th_a       db_management.cpp:205         force_slow_replays   ] enabling slow replays
1332429ms th_a       bookie_plugin.cpp:502         plugin_initialize    ] bookie plugin: plugin_startup() end
1332429ms th_a       bookie_plugin.cpp:507         plugin_startup       ] bookie plugin: plugin_startup()
1332429ms th_a       db_maint.cpp:1066             process_dividend_ass ] In process_dividend_assets time 2015-05-15T14:26:45
1332429ms th_a       db_maint.cpp:742              schedule_pending_div ] Processing dividend payments for dividend holder asset type TEST at time 2015-05-15T14:26:45
1332429ms th_a       db_maint.cpp:796              schedule_pending_div ] Current balances in distribution account: 0, Previous balances: 0
1332433ms th_a       db_management.cpp:185         close                ] Database close unexpected exception: {"code":10,"name":"assert_exception","message":"Assert Exception","stack":[{"context":{"level":"error","file":"fork_database.cpp","line":43,"method":"pop_block","hostname":"","thread_name":"th_a","timestamp":"2019-09-09T14:22:12"},"format":"prev: poping block would leave head block null","data":{}},{"context":{"level":"warn","file":"db_block.cpp","line":514,"method":"pop_block","hostname":"","thread_name":"th_a","timestamp":"2019-09-09T14:22:12"},"format":"","data":{}}]}
1332496ms th_a       db_management.cpp:185         close                ] Database close unexpected exception: {"code":3070001,"name":"pop_empty_chain","message":"there are no blocks to pop","stack":[{"context":{"level":"error","file":"db_block.cpp","line":506,"method":"pop_block","hostname":"","thread_name":"th_a","timestamp":"2019-09-09T14:22:12"},"format":"there are no blocks to pop","data":{}},{"context":{"level":"warn","file":"db_block.cpp","line":514,"method":"pop_block","hostname":"","thread_name":"th_a","timestamp":"2019-09-09T14:22:12"},"format":"","data":{}}]}

*** No errors detected

pbsa07@pbsa08:~/src/peerplays$ ./tests/chain_test -t account_history_tests/track_account2
Random number generator seeded to 1568038974
GRAPHENE_TESTING_GENESIS_TIMESTAMP is 1431700002
Running 1 test case...
1374933ms th_a       object_database.cpp:94        open                 ] Opening object database from /tmp/graphene-tmp/3e62-f9e1-6462-0c0c ...
1374934ms th_a       object_database.cpp:100       open                 ] Done opening object database.
1374937ms th_a       bookie_plugin.cpp:469         plugin_initialize    ] bookie plugin: plugin_startup() begin
1374938ms th_a       db_management.cpp:205         force_slow_replays   ] enabling slow replays
1374938ms th_a       bookie_plugin.cpp:502         plugin_initialize    ] bookie plugin: plugin_startup() end
1374938ms th_a       bookie_plugin.cpp:507         plugin_startup       ] bookie plugin: plugin_startup()
1374938ms th_a       db_maint.cpp:1066             process_dividend_ass ] In process_dividend_assets time 2015-05-15T14:26:45
1374938ms th_a       db_maint.cpp:742              schedule_pending_div ] Processing dividend payments for dividend holder asset type TEST at time 2015-05-15T14:26:45
1374938ms th_a       db_maint.cpp:796              schedule_pending_div ] Current balances in distribution account: 0, Previous balances: 0
1374940ms th_a       db_management.cpp:185         close                ] Database close unexpected exception: {"code":10,"name":"assert_exception","message":"Assert Exception","stack":[{"context":{"level":"error","file":"fork_database.cpp","line":41,"method":"pop_block","hostname":"","thread_name":"th_a","timestamp":"2019-09-09T14:22:54"},"format":"_head: no blocks to pop","data":{}},{"context":{"level":"warn","file":"db_block.cpp","line":514,"method":"pop_block","hostname":"","thread_name":"th_a","timestamp":"2019-09-09T14:22:54"},"format":"","data":{}}]}
1374979ms th_a       db_management.cpp:185         close                ] Database close unexpected exception: {"code":3070001,"name":"pop_empty_chain","message":"there are no blocks to pop","stack":[{"context":{"level":"error","file":"db_block.cpp","line":506,"method":"pop_block","hostname":"","thread_name":"th_a","timestamp":"2019-09-09T14:22:54"},"format":"there are no blocks to pop","data":{}},{"context":{"level":"warn","file":"db_block.cpp","line":514,"method":"pop_block","hostname":"","thread_name":"th_a","timestamp":"2019-09-09T14:22:54"},"format":"","data":{}}]}

*** No errors detected

@bobinson bobinson merged commit 9224af5 into develop Sep 9, 2019
@bobinson bobinson added merged and removed ready2merge PRs reviewed and ready for merge, but not merged due to HF or other dependencies labels Sep 9, 2019
@bobinson
Copy link

feature build is failing and we need to investigate this

refer: https://gitlab.com/PBSA/peerplays/-/jobs/303662214

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