-
Notifications
You must be signed in to change notification settings - Fork 977
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
In memory testing #4562
In memory testing #4562
Conversation
I don't think that's the reason, the upgrade is there to make sure that ledgers with upgrades can be externalized out of order (that's important due to how config changes impact the internal core state). #4012 is the issue for which this has been introduced. So I don't think we should remove this.
Yeah, I think that's the right course of the action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @dmkozh that the upgrade-specific logic seems important to test here.
Alternatively, we can maybe go through the full upgrade arming process with BucketListDB support instead of cutting corners with direct ltx commits.
I think this is a good idea even independent of the details of this specific test. When possible, avoiding the corner-cutting should lead to a more realistic and better overall test IMO.
Got the test to work with BucketList friendly upgrades and pushed some cleanups around |
4605954
to
76a92d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes! I don't have permissions to mark comment threads as "resolved" in this repo, but you can consider all of my comments resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks good -- it's hard to understand the motive exactly and the exact nature of the repurposing that's going on here (had to chat with you) so I think some additional comments would be good, but I think that's about all. A couple other nits I was curious about noted along the way. Happy to try to get it landed quickly so you don't need to keep rebasing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, a few comments/questions
4339f73
to
20f5fea
Compare
Description
Resolves #4501 and partially resolves #4502
This PR removes
--in-memory
. Specifically, core will not crash if this flag is passed in for Horizon compatibility reasons, but will ignore it and related flags.Additionally,
--in-memory
has been cannibalized to use in testing. Previously, any test that committed changes directly to the root ltx was incompatible with BucketListDB and required SQL. This is an issue, as we are deprecating SQL for ledger state, and it would not make sense to maintain this SQL overhead for testing only. While I've removed most of thein-memory
code, I've saved the bits regarding the never committing ledger root to use for the direct ltx commit test cases. Thus we remove the test dependency for SQL.In order to properly test the orderbook, the
in-memory
testing mode still maintains and queries a SQL database just for offers (similar to what BucketListDB does).Originally I did one PR for removing SQL,
--in-memory
and mandating background eviction. This was way to big to merge but may be helpful in providing context on what changes are in flight after this PR: #4504.Currently everything works except for the "herder externalizes values" test. With BucketListDB testing mode, nodes can be restarted, but direct ltx commits are not supported. With the in-memory mode testing, ltx can be committed to directly, but nodes can not be restarted.
For all tests except for "herder externalizes values", this if fine. However, "herder externalizes values" is the only test that both directly commits to the ltx and restarts nodes. In particular, thesetupUpgradeAtNextLedger
function directly commits to the ltx. I've seperated the test into two helper functions, one that doesn't require restart and one that does. I think that the restart test doesn't actually require an upgrade to occur. I think the test just used upgrades in order to populate ledgers with some meaningful, detectable work to make sure externalized ledgers aren't applied several times. If the upgrade operation is not integral to this test, we can probably find a workaround. Alternatively, we can maybe go through the full upgrade arming process with BucketListDB support instead of cutting corners with direct ltx commits. I'm not well versed in herder tests though, so I've left the failing test as is. If we can remove the upgrade and check the condition some other way, this is the path of least resistance.Test has been fixed to use upgrades compatible with BucketListDB.
Checklist
clang-format
v8.0.0 (viamake format
or the Visual Studio extension)