Nano-node: Asserts

Created on 6 Jan 2018  路  17Comments  路  Source: nanocurrency/nano-node

During development and testing, I open and close the node/wallet a lot, and I get various asserts on exit from time to time. The last one:

Assertion failed: (size_a == sizeof (rai::uint256_union) + sizeof (rai::uint256_union)), function received_frontier, file rai/node/bootstrap.cpp, line 314.

I assume this is because shutting down the node doesn't clean up in-flight requests properly? Quite a few of the asserts could probably be handled more gracefully as runtime errors.

bug help wanted

Most helpful comment

I created a cycle test to repeatedly start the node and shut it down. This assertion happens frequently.

All 17 comments

You're seeing this on master or one of the official releases? Can you create a test case for this failure?

@androm3da On master. I'll make a note about the test case, I may be able to look into it a bit later. But I think someone more familiar with the code should evaluate if some of the asserts should be handled more gracefully (intermittent network issues shouldn't crash the node/wallet)

I created a cycle test to repeatedly start the node and shut it down. This assertion happens frequently.

Is the cycle test on a branch?

@androm3da The reason is that the connection is closed while async_read is in flight. This results in a zero-size completion.

I'll cook up a patch.

Thanks @cryptocode

No, @ztbrown the cycle test isn't shared anywhere. It was pretty quick'n dirty but I will make a PR.

@androm3da btw, some tests seem to fail on master (macos), frontier_req.begin for instance (Expected: rai::test_genesis_key.pub)

Thanks for the heads up, I will take a look.

@ztbrown I have not gotten around to cleaning up the cycle test yet but I can share it here:

https://gist.github.com/androm3da/2003a360849cad55e59d1cafbab11e46

Ideally it would have clear pass/fail success criteria and be much less sensitive to interpretation. But I just needed something quick to give a big picture.

Depends on requests, loop it in your shell, e.g. while true; do ./cycle_test.py; done

@androm3da: thanks for this!

Where is requests imported from? I don't see any other modules importing it.

It's an external dependency.

e.g.

virtualenv xrb_test
source xrb_test/bin/activate
pip install requests
./cycle_test.py

Also I think it depends on being able to find ./rai_node in the current dir, and a reference config file -- restart_test_reference.json.

This was very helpful, thanks. I am now having issues with restart_test_reference.json. Is that generated? I don't see it in the repo or anywhere in my build.

Any baseline config.json should work but I uploaded the one that I used to the gist.

I don't know how I missed it. Thank you!

I only just added it.

But now there's a PR to revert the fix. :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

henry701 picture henry701  路  5Comments

starrynightglider picture starrynightglider  路  5Comments

termhn picture termhn  路  4Comments

hskang9 picture hskang9  路  4Comments

bbedward picture bbedward  路  3Comments