-
Notifications
You must be signed in to change notification settings - Fork 28
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
simfile: Add ability to run from specified simulated network topology #174
Closed
Conversation
This file contains 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
- additionally, remove every `unwrap()` call that could panic, replacing with error propagation and/or context with `expect()` - return Result<(), SimulationError> for all spawned tasks - handles triggering shutdown at call site for spawned tasks - move starting/stopping logs to spawn site
carlaKC
force-pushed
the
run-sim
branch
2 times, most recently
from
March 14, 2024 17:28
cdcb892
to
f894fbc
Compare
…isten-and-trigger-universally refactor: use listen and trigger universally
… to sim.json file
We handle balances in settle_htlc, so do not need to shift local balance in remove_outgoing_htlc.
With the previous code, our removal loop would not execute for a resolution index of zero. To fix this, we make the loop inclusive and provide the appropriate index for successful HTLCs (failing HTLCs already use the correct failure index).
To allow more isolated testing of channel state, move balance updates to function on the individual sides of the channel.
sim_network: Add unit tests + squash bugs
Adds clippy to gh actions and fixes clippy issues
…nd-count Issue bitcoin-dev-project#168: Adding optional start and count values to sim.json file
…ment Update method parameter to take reference to PaymentHash
…u-fix Issue bitcoin-dev-project#182 Fixes a problematic loop in produce_simulation_results
Stable will upgrade our version, which means that CI can spontaneously break.
…d-pin workflows: pin clippy version
Nodes and activity are not included here, because we want to be able to create our config struct separately from parsing of nodes and activity. This reasoning will become more apparent in future commits when we add two different running modes for the simulator (regular operation and simulated network mode).
This commit moves validation of activities into a dedicated function, decoupling it from access to our full set of nodes. This is done in preparation for adding simulated networks, where we don't have our simulated node implementations available at the point where we need to validate our activity.
It's possible that two nodes don't set any alias, and then we'd fail our alias map check. This commit updates our validation to only track alias if it isn't empty to allow this.
Closing because this has been inactive for a while, I'll re-open when I have some time to clean it up. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds the ability to run sim-ln with a simulated network specified in the simulation file. It is primarily refactoring of
main
to break things up into a few functions, and adds the following:sim_network
field tosim.json
which can be used toDepends on #175 !