-
Notifications
You must be signed in to change notification settings - Fork 2.2k
lnwire: prune dead code #7690
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
base: master
Are you sure you want to change the base?
lnwire: prune dead code #7690
Conversation
PkScript is a relic from the time before BOLTs [1] and is unused anywhere but tests today. [1] lightningnetwork@fc9ebb5
We use specialized functions to encode/decode ShortChanIDEncoding, so the cases for this type in ReadElement and WriteElement are dead. It appears the case in ReadElement was dead on arrival [1] while the case in write element became dead later on. [1] https://github.com/lightningnetwork/lnd/pull/1106/files
After lightningnetwork#4884, many of the cases in WriteElement are now dead.
How did you determine this code to be dead? We're using parts of the |
I only verified the code is unused within LND. From a quick search on GitHub, indeed some of these are used by Pool. IME GitHub's search sucks and doesn't return complete results, so it's hard to know what's used by projects outside of Pool/Loop. And actually anyone could be using any publicly exported function or type from any LND package, whether their project is on GitHub or not. Which brings up some important questions -- how much do we care about breaking LND-as-a-library use cases? Is there a deprecation policy? There is already a TODO in the code to remove |
Hmm, so if the goal is to get rid of
Question out of interest: How did you verify that? Since the call site in question doesn't have any compile time guarantees. Just from passing unit/integration tests or by inspecting each existing call site? |
Sure.
I inspected call sites and removed unused code, then verified all tests still pass. |
Pool refactor: lightninglabs/pool#449 |
No description provided.