Merged
Conversation
The PhoenixBusiness object is tied to a specific wallet. It can be destroyed, or many instances can be created. It's not suited for routines that have application-wide scope, such as the Currency Manager. Note that this is also true for a few other things, like the network state monitoring, or the mempool.space fee estimation. As such a PhoenixGlobal class has been added with the expecation that it's created at application startup, and that it is unique. Note that it probably could be a singleton, TBD. The CurrencyManager logic is the same as before, though there are some changes: the APIs objects have been moved to separate file in a distinct package for readability. Also, the flow of watched currencies is now stored in this Manager, and not in the AppConfigManager.
Also rollback change to WalletPaymentsMetadata queue class: we need to fetch the fiat exchange rate when retrieving the metadata before inserting new payments to the database. The monitored currencies is now a map wallet->currencies which is easier to maintain when running multiple wallets in parallel.
2cc7c76 to
0f83437
Compare
robbiehanson
approved these changes
Oct 2, 2025
This file contains hidden or 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
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 introduces a
PhoenixGlobalobject that shares various managers that used to be tied to thePhoenixBusinessobject, but whose scope is actually application-wide.Rationale : the
PhoenixBusinessarchitecture in the phoenix-shared module made assumptions that do not work with the multiple wallets update. Specifically, any "global" flow that is not specific to a given node should be shared, and not be tied to a specificPhoenixBusinessobject.For example, we need only 1 single
CurrencyManagerthat will share its exchange rates data between all nodes running on the app. Same is true for the mempool.space feerate estimation, or the wallet-context fetcher.