-
Notifications
You must be signed in to change notification settings - Fork 0
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
Deprecate wallet2 and replace it with the Seraphis lib #64
Comments
@r4v3r23 proposed an interesting idea as well to me in DM's. Before replacing the entirety of wallet2 in the wallet API in Step 1, Step 0.5 could be to replace just the scanner. My knee-jerk reaction was it might cause more headache later, but it should be smooth if done like this pseudocode:
Since we'd want to be able to use wallet2 "in a box" to construct a tx, then we'd need |
Thanks for moving this, appreciated. Interesting proposal, and I guess an almost logical consequence of all now quite substantial "delays" that we have with implementing our new wallet, for various reasons: The ideal, a brand-new API designed out on a green field, is probably a luxury we can't afford anymore timewise. A question: Why take If we can pull off your trick even with |
I don't see much benefit to getting rid of I do think the wallet API offers a solid base of abstraction to build from that makes it easier to drop This is generally postulation on my part though from eyeing the code and working with it. I'm strongly warming to this idea to start an incremental approach with the scanner. |
Hmm, you are not afraid that if you add absolutely everything that wallet apps need for their fully current functionality, |
Ya it's a concern, I included that as a challenge to this approach. I think following similar coding practices as the Seraphis lib (clean class separation, shorter functions, measured design decisions to name a few), it's avoidable. Example: the Seraphis lib's modular scanner shows how we can replace a major component of wallet2 with cleaner structured code. That's why I'm thinking the scanner is a good place to start. |
i support this modular approach since according to rbrunner7 a new api is out of the question, reusing the current one and making the seraphis essentially a drop-in replacement update for current wallets is a massive plus will be helping @j-berman test his upcoming scanner once its ready |
I agree that now we have so many Seraphis components that integrating into the existing code starts to be the main challenge. I like your organizational proposal as it tries to set a clear path to use some seraphis features though I dont know if it is the best approach to build wallet3 since we cant add all features into the wallet2_api and it constrains us with wallet2 design. But at least looks like we have an approach now. So let me rephrase some of your ideas to try to understand it and let me try to frame what I can do to contribute. Also, I disagree with @rbrunner7 here. Looking at how the seraphis_lib work, Koe did such an excellent job that it is already doing a great deal of the work that the wallet2 functions do. Therefore implementing a wallet and an api for seraphis should be much easier than implementing wallet2 again.
Anyway, moving forward with this thought. Step 1: wallet API - stop using wallet2 (m_wallet) but keep using the API How exactly would we do that? I can imagine taking the following path: We create a So it means implementing the methods from:
Is that what you think? I think it would be nice to initially target a high degree of compatibility with the In the same way, since the |
I was thinking something a bit different.
I was imagining systematically going through each I loosely categorize what
I think most functions could be structured better and "housed" into a better bin. I was thinking something along these lines... The keys can get their own class referenced via The settings can get their own class referenced via The enote store can capture wallet state. We'd rewrite wallet2 functions into Seraphis-style functions ( Static functions can be refactored. |
Interesting. So basically the bug free seraphis_wallet is the non existing seraphis_wallet ? :p |
Would eliminate dependencies on |
I have been reading through the discussion so far and tried to understand the various ideas and approaches mentioned here, and I am not sure whether I fully understood what everbody tried to say and whether also people fully understood each other so far. This is perhaps not surprising, because it's a difficult endeavor. Faced with a difficult and complex programming task I always try to radically simplify it first and find a way to do it using steps of manageable size. IMHO in this case, all on my own, I would probably try the following first: Put away any Seraphis library code for the time being. Work strictly only within the frame of existing Monero code. Basically, just complete at long last what that "Wallet API" originally set out to do but did not fully accomplish: Create a new, cleaner and better structured wallet API that supersedes End goal: You can write any wallets and wallet-like apps like the RPC server, even fully featured ones like the CLI wallet, by using the "Wallet API" only, without using anything from That would mean going systematically going through Hopefully the amount of new code needed would be pretty small, with most code just use one thing or another from Result would be something that we could PR to the existing Monero codebase without problems, because, again, it would not yet include any parts of the Seraphis lib, reviews should be possible in a short timeframe, with many people being able to review in the first place, and wallet devs could start to use it anytime. Of course, once that's out of the door, you can continue and almost immediately start to use e.g. @j-berman 's new scanner together with the Seraphis lib parts that it needs. |
FWIW no one disagreed with the end goal.
I would even break it down further and add an intermediate goal: Here is an incomplete list of "API Tasks" that I see so far:
* I'm not sure about this. First I planned to handle |
Goals
Challenges
m_wallet
insimplewallet.cpp
andwallet_rpc_server.cpp
).m_wallet
inwallet/api/wallet.cpp
).Proposed plan
Step 1: wallet API
Stop using the wallet2 object directly in the wallet API, and instead use the Seraphis lib, except to construct legacy txs.
m_wallet
193 times).Step 2: CLI and RPC wallets
Stop using the wallet2 object directly in the CLI and RPC wallets, and instead use the wallet API.
m_wallet
724 times, RPC 368 times).Note: technically the above 2 steps can be done in parallel, but I figured it would be a cleaner process to prioritize 1 first.
Why keep the wallet API?
The text was updated successfully, but these errors were encountered: