talaia-labs / rust-teos

The Eye of Satoshi - Lightning Watchtower
https://talaia.watch
MIT License
128 stars 62 forks source link

Simplifies the cln plugin option parsing #170

Closed sr-gi closed 1 year ago

sr-gi commented 1 year ago

Options include helper functions to convert them to their proper type after cln-plugin=0.1.2. Use that to reduce the option parsing boilerplate.

Also move all names, descriptions and default values for options, rpc_methods and hooks to a new file.

mariocynicys commented 1 year ago

Ok now it makes sense why the PR's name is not very inclusive. I think you included changes from #160 in here by mistake in 4c9141f.

sr-gi commented 1 year ago

Oh yeah, this is not pulling from master giving cln-plugin=0.1.2 is bumped in #160, and this PR builds on top of that.

This will need rebasing once #160 gets merged, but given it was double at this stage and didn't require much more I went ahead and fixed it.

sr-gi commented 1 year ago

Rebased and amended this so it pulls from master.

I've also moved a bit more data to constants.rs to reduce the hardcoded stuff in main.rs.

sr-gi commented 1 year ago

Rebased and amended this so it pulls from master.

I've also moved a bit more data to constants.rs to reduce the hardcoded stuff in main.rs.

Looks like I've broken the plugin by doing this 😅, not exactly sure why though.

sr-gi commented 1 year ago

Rebased and amended this so it pulls from master. I've also moved a bit more data to constants.rs to reduce the hardcoded stuff in main.rs.

Looks like I've broken the plugin by doing this 😅, not exactly sure why though.

Fixed it, auto-retry-delay default value was beyond u16::MAX. Looks like this was not caught in https://github.com/talaia-labs/rust-teos/commit/07caee2dbda894db462768290af2c922f1e30124 because the default was set in two different places on the codebase:

https://github.com/talaia-labs/rust-teos/blob/07caee2dbda894db462768290af2c922f1e30124/watchtower-plugin/src/main.rs#L544-L547

https://github.com/talaia-labs/rust-teos/blob/07caee2dbda894db462768290af2c922f1e30124/watchtower-plugin/src/main.rs#L625-L629

mariocynicys commented 1 year ago

@sr-gi One of the failures though wasn't in the e2e tests: https://github.com/talaia-labs/rust-teos/actions/runs/3884258978/jobs/6626583255

This panicked while checking if the retrier is idle. Guess the sleep time is too tight?

sr-gi commented 1 year ago

@sr-gi One of the failures though wasn't in the e2e tests: https://github.com/talaia-labs/rust-teos/actions/runs/3884258978/jobs/6626583255

This panicked while checking if the retrier is idle. Guess the sleep time is too tight?

That's my guess, unfortunately, I haven't been able to reproduce it locally