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

Andrew7234/emerald statecheck #319

Merged
merged 1 commit into from
Feb 21, 2023
Merged

Conversation

Andrew7234
Copy link
Collaborator

@Andrew7234 Andrew7234 commented Feb 16, 2023

Checks emerald accounts + balances in the runtime_sdk_balances against node-returned information.

Currently fails as expected due to dead reckoning balance tracking only from the beginning of Damask.

=== RUN   TestEmeraldAccounts
    genesis_test.go:841: Initializing data stores...
    genesis_test.go:856: Runtime ID determined runtime emerald runtime_id 000000000000000000000000000000000000000000000000e2eaa99fc008f87f
    genesis_test.go:864: Creating checkpoint for emerald tables...
    genesis_test.go:868: Fetching accounts information at height 1005793...
    genesis_test.go:875: Fetched 65846 account addresses addresses
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: 20023776342168206
        	            	actual  : 3000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: -2260169826835984491
        	            	actual  : 3000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: 4815653720999948899
        	            	actual  : 3000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: -4802016784252571859
        	            	actual  : 3000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: -4773687720101115891
        	            	actual  : 6000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: -8423139063088401375
        	            	actual  : 3000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: -4157187325998129697
        	            	actual  : 3000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: 9057868994841401948
        	            	actual  : 9000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: 230983870891582226
        	            	actual  : 3000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: -3095242663383417200
        	            	actual  : 3000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: -5265563231720844112
        	            	actual  : 6000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: -4424068908859350146
        	            	actual  : 3000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: 461138744981466182
        	            	actual  : 3000000000000000000
        	Test:       	TestEmeraldAccounts
    genesis_test.go:889:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:889
        	Error:      	Expected nil, but got: pgx.ScanArgError{ColumnIndex:1, Err:(*errors.errorString)(0xc0005046c0)}
        	Test:       	TestEmeraldAccounts
    genesis_test.go:911:
        	Error Trace:	/Users/andrewlow/oasis/oasis-block-indexer/tests/genesis/genesis_test.go:911
        	Error:      	Not equal:
        	            	expected: 7955676872032363197
        	            	actual  : 0
        	Test:       	TestEmeraldAccounts
    genesis_test.go:923: address oasis1qqqqqf836rj8zkv739387geu29u5pf4665jkuuj7 expected, but not found
    genesis_test.go:923: address oasis1qqqqpn9xn7sss7zjd6f5u8wpfxrfql0x2sslcncp expected, but not found
    genesis_test.go:923: address oasis1qqqqzfa2pc7gz5z2eqza2jz4akzeg6rnd52666xd expected, but not found
    genesis_test.go:923: address oasis1qqqqz7cxeda2ggjsrmyns3d3e579vc7eeuav4sqa expected, but not found
    genesis_test.go:923: address oasis1qqqqxzlsdhs35kgnl8dhqnstqxwfygjz4ymkaznz expected, but not found
    genesis_test.go:923: address oasis1qqqqf7093f05cg65qrhqercv3u7sczldqsm7sawj expected, but not found
    genesis_test.go:923: address oasis1qqqqdrmsphaxpxh7puqcttg2n8wr7tdgnc0lhhz2 expected, but not found
    genesis_test.go:923: address oasis1qqqqd03v9wnq30eumwfueymma9ulw05nu5wpgjke expected, but not found
    genesis_test.go:923: address oasis1qqqqws9v8d8s5459w8uwp455cvglahcd0yhc76xf expected, but not found
    ... a billion more rows...
--- FAIL: TestEmeraldAccounts (520.97s)
FAIL

@Andrew7234 Andrew7234 self-assigned this Feb 16, 2023
@Andrew7234 Andrew7234 added the testing Reliability testing. label Feb 16, 2023
Copy link
Contributor

@mitjat mitjat left a comment

Choose a reason for hiding this comment

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

Nice! I have some suggestions on how to structure this more cleanly (also with an eye on future similar tests), but the core of it looks good and quite elegant!

storage/api.go Outdated Show resolved Hide resolved
tests/emerald/emerald_test.go Outdated Show resolved Hide resolved
tests/emerald/emerald_test.go Outdated Show resolved Hide resolved
tests/emerald/emerald_test.go Outdated Show resolved Hide resolved
tests/emerald/emerald_test.go Outdated Show resolved Hide resolved
tests/emerald/emerald_test.go Outdated Show resolved Hide resolved
tests/emerald/emerald_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@mitjat mitjat left a comment

Choose a reason for hiding this comment

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

Nice!

tests/statecheck/util.go Outdated Show resolved Hide resolved
tests/statecheck/runtime_test.go Outdated Show resolved Hide resolved
@Andrew7234 Andrew7234 force-pushed the andrew7234/emerald-statecheck branch from 0569931 to dd5cdee Compare February 21, 2023 19:17
wip: runnable version of emerald account state check

update checkpoint table for runtimes

[tests] clean up emerald account state check

nit

nit

refactor tests; address comments

nit

lint

nits

nits
@Andrew7234 Andrew7234 force-pushed the andrew7234/emerald-statecheck branch from dd5cdee to ee5cab6 Compare February 21, 2023 19:22
@Andrew7234 Andrew7234 merged commit 8ae6e99 into main Feb 21, 2023
@Andrew7234 Andrew7234 deleted the andrew7234/emerald-statecheck branch February 21, 2023 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Reliability testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants