Skip to content
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

Rb update mc #133

Closed
wants to merge 24 commits into from
Closed

Rb update mc #133

wants to merge 24 commits into from

Conversation

ellemouton
Copy link
Owner

@ellemouton ellemouton commented Aug 12, 2024

TODO: write test

Copy link

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

@ellemouton ellemouton force-pushed the rb-updateMC branch 2 times, most recently from f2a90fd to 5483f15 Compare August 12, 2024 16:25
To prevent the need to copy the entire onion_error.go file for a new
Mission Control migration, this commit just updates the existing
lnwire21/onion_error.go file with the new CodeInvalidBlinding code. The
lnwire21 should not really ever be updated but adding a new code should
be fine as it does not affect old migrations since this is a new code.
In preparation for the commit which will add the main logic for
migration 32 (which will migrate the MC store to use a more minimal
encoding), this commit just adds some of the code that the migration
will need to the package.
Add a new mcRoute type that houses the data about a route that MC
actually uses. Then add a migration (channeldb/migration32) that
migrates the existing store from its current serialisation to the new,
more minimal serialisation.
So that `missionControlStore` can be unaware of the backing DB structure
it is writing to. In an upcoming commit when we change mission control
to write to namespaced buckets instead, we then only need to update the
`namespacedDB` implementation.
In this commit, the mission control store is migrated such that all
existing pairs which are currently stored directly in the top level
results bucket are now instead moved to a "default" namespace bucket.

Note that this migration is not yet invoked in this commit. The
migration will be invoked in the same commit that starts writing and
reading the new format.
and invoke the associated mission control migration.
Only the MissionControl instance should use this variable and it should
not be accessible to users of MissionControl.
@coveralls
Copy link

coveralls commented Aug 14, 2024

Pull Request Test Coverage Report for Build 10388847757

Details

  • 460 of 1336 (34.43%) changed or added relevant lines in 25 files are covered.
  • 22973 unchanged lines in 399 files lost coverage.
  • Overall coverage decreased (-8.4%) to 50.146%

Changes Missing Coverage Covered Lines Changed/Added Lines %
routing/blindedpath/blinded_path.go 17 18 94.44%
routing/result_interpretation.go 13 15 86.67%
rpcserver.go 5 8 62.5%
invoices/invoiceregistry.go 21 28 75.0%
server.go 34 43 79.07%
channeldb/migration/lnwire21/onion_error.go 0 21 0.0%
channeldb/models/blinded_paths.go 96 123 78.05%
channeldb/migration32/migration.go 0 29 0.0%
channeldb/migration32/hop.go 0 30 0.0%
channeldb/models/route.go 70 102 68.63%
Files with Coverage Reduction New Missed Lines %
graph/errors.go 1 94.74%
lnwire/typed_lease_expiry.go 2 78.95%
lnwire/typed_fee.go 2 66.67%
htlcswitch/linkfailure.go 2 51.72%
channeldb/forwarding_policy.go 2 85.14%
lnwallet/musig_session.go 2 79.29%
server.go 2 63.71%
record/hop.go 2 93.33%
lnwire/short_channel_id.go 2 89.74%
lnrpc/signrpc/signer_grpc.pb.go 2 59.73%
Totals Coverage Status
Change from base Build 10369957973: -8.4%
Covered Lines: 96497
Relevant Lines: 192432

💛 - Coveralls

This commit renames the previous MissionControl to MissionController and
the previous MissionController interface to MissionControlQuerier. This
is done because soon the (new) MissionController will back multiple
namespaced MissionControl instances.  For now, it just houses a single
MissionControl in the default namespace.
TODO: remove replace once dependent PR is merged.
This new struct holds the zpay32.BlindedPaymentPath along with other
useful info about the constructed path like:
1) the session key: which we can later use (as the path constructor) to
   decrypt the blobs we sent to each blinded hop in the path.
2) the last ephemeral pub key which we can use to uniquely identify this
   path.
Move it to the models package to avoid import cycles later on.
instead of route.Route. This will be useful for a later commit when we
only have access to MCRoute and want to report success to MC.
Note that then new field is not yet persisted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants