-
Notifications
You must be signed in to change notification settings - Fork 129
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
sauron: Add mutinynet and tests #584
Conversation
f343745
to
7519cc6
Compare
f80de9a
to
0e7c007
Compare
0e7c007
to
b8ca105
Compare
You need to pin the version of |
You might want to add some instructions in the README for how to start sauron with Mutinynet. Below command worked for me once I had |
a5483ee
to
70dc8ad
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.
See comments
@sip-21 Can you please give me more details about the tests you wrote and what were you trying to do when Sauron failed? I am trying to replicate it to fix it. Thanks! |
@ca-ruz The failing GitHub actions/tests are here: https://github.com/sip-21/plugins/actions/runs/11116007452/job/30885476517?pr=15
The tests run fine together locally, but in GitHub action
|
ec3295c
to
ece41a9
Compare
.ci/test.py
Outdated
@@ -241,13 +241,14 @@ def run_one(p: Plugin, workflow: str) -> bool: | |||
|
|||
logging.info(f"Virtualenv at {vpath}") | |||
|
|||
num_workers = 1 if p.name == "sauron" else 5 |
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.
@sip-21 didn't you fix the concurrency? We can get rid of this I think?
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.
If removing this breaks the tests, we should add the changes to this file back, but under the other commit (the one that adds the tests).
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.
Removed these lines from the code. Tests are all failing now.
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.
We're almost there! Just a couple of minor issues.
After adding back concurrency, the tests are failing because they're trying to listen on port 9735... that actually doesn't seem necessary. Can you fix the tests not to require listening on port 9735? (or maybe just listen on a random port) |
|
||
self.daemon = LightningD(lightning_dir, None) # noqa: F405 | ||
options = { | ||
"disable-plugin": "bcli", |
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 don't think you need to override this class at all. Just set the options appropriately when using the NodeFactory.get_node()
. That'll obviate the need for the subclass and the fixtures.
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.
Hey @cdecker it looks like we actually do need to override both the LightningNode
class and the LightningD
class.
We need to override the LightningNode
class because it doesn't allow us to override self.daemon
as you can see in this code here: https://github.com/ElementsProject/lightning/blob/e66653fa1d847e28bd812356a762225a44bfae83/contrib/pyln-testing/pyln/testing/utils.py#L780-L783
In addition, we have to override the LightningD
class because there is no way to instantiate it without the bcli
options which are set here: https://github.com/ElementsProject/lightning/blob/e66653fa1d847e28bd812356a762225a44bfae83/contrib/pyln-testing/pyln/testing/utils.py#L618-L622
These options if set, crash lightningd
when bcli
is disabled.
On top of this, the LightningD.start
method requires bitcoin-rpcuser
to be set (which as above crashes lightningd
when we disable bcli
). You can see this here: https://github.com/ElementsProject/lightning/blob/e66653fa1d847e28bd812356a762225a44bfae83/contrib/pyln-testing/pyln/testing/utils.py#L667
So unfortunately we need to leave these classes as they are unless I'm missing something.
Please don't override the fixtures and the node class unless you absolutely need to. |
@cdecker do you have an example of any pytests that use the JSON schema from CLN to check the fields and types? That sounds amazing! |
It's done automatically by instrumenting the pyln-client library to load and check the schemas. Anything going through pyln-client in a test environment should be checked afaik. I don't think notifications and hooks are checked yet (there are no schemas yet), but that'd be an amazing extension covering the docs vs implementation too |
@chrisguida @cdecker @sip-21 Made some changes to the tests. |
@ca-ruz some tests still failing, looks like blockstream is ratelimiting us |
@chrisguida Guess we need to work on a workaround for that! |
@chrisguida @sip-21 Skipped the sendrawtransaction_invalid test across all backends since we were intentionally sending an invalid transaction to test the API call and response. Esplora had been rate-limiting us, likely due to the high frequency of invalid requests. We know the call works because we get an expected response from the API. |
ec75e38
to
65d895d
Compare
@ca-ruz just make an issue to refactor these tests to repeat ourselves less, and clean up the commits, then let's merge |
@chrisguida I've created an issue to address this: #622. |
65d895d
to
18d127c
Compare
18d127c
to
0f6a7a3
Compare
0f6a7a3
to
762606a
Compare
Co-authored-by: iorch <[email protected]>
Co-authored-by: ca-ruz <[email protected]>
762606a
to
569dabb
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.
Adds mutinynet support to sauron. Mutinynet.com uses the mempool.space REST API, which has a slightly different spec from blockstream's Esplora so there is new code to handle that.
We pinned pyln-client to <=24.5 because version 24.8 has some extra requirements that sauron does not meet, we should probably fix this but for now pinning 24.5 should work fine.