MerosCrypto / Meros

An instant and feeless cryptocurrency for the future, secured by the Merit Caching Consensus Mechanism.
https://meroscrypto.io
Other
83 stars 19 forks source link

New RPC. #279

Closed kayabaNerve closed 3 years ago

kayabaNerve commented 3 years ago

https://github.com/MerosCrypto/Meros/tree/new-rpc is a branch for the new RPC, solving the design issues with the current RPC. This is a tracking issue for this new branch, which will solve:

265 (TCP RPC < HTTP RPC)

214 (insecure)

162 (bug in setMnemonic)

278 (abuseable memory growth in getBlockTemplate)

It will also fix the usage of array parameters for every route (vastly inferior to using objects) and implement currently unimplemented routes.

As #265 noted, the we'll have to write our own HTTP code, unfortunately. #214 will be resolved using HTTP Bearer Auth. #278 already details its fix, and #162 doesn't have a fix up for discussion.

kayabaNerve commented 3 years ago

This branch is apparently now encompassing our usage of BIP 32, BIP 39, and BIP 44, due to the RPC exposing them and defining certain flows.

kayabaNerve commented 3 years ago

All modules are on the new macro. Next up is fleshing out the routes.

Before moving to HTTP, I'd like to port over the Python tests, and when those still run, work on testing the methods as a whole.

Once the tests work again, the methods are implemented and tested, then I'd like to move to HTTP. The Python code outsources all actual RPC transmission to a wrapper, so that shouldn't be a concern to update to.

kayabaNerve commented 3 years ago

With the new RPC, providing an extremely standardized way to interact with it, I'd like to do the following:

Speaking of, before this is merged, Meroxidizer must be updated. The RPC sample also needs to be.

kayabaNerve commented 3 years ago

As part of this, I'd like to deprecate https://github.com/MerosCrypto/Nim-MerosRPC. It's not used by any active codebase and Nim is quite niche. The one program we created which used it was Mineros, and that has been archived. We're also not starting new apps in Nim at this time. While that isn't an official, nor static, policy, the few apps we have started/hosted (asmr/Meroxidizer) recently have been in Rust.

If we do need a Nim RPC lib, we can unarchive it and update it at that time. It is quality code using a macro off a list of route definitions. The main annoyance is committing to maintaining it, when I arguably don't even want to advocate using it, as it'd be used with Nim.

kayabaNerve commented 3 years ago

Currently, we don't return 404 for GET/HEAD, which is technically spec non-compliance. In order to speed this up, support for HTTP pipelining has also been removed as a requirement. A new issue should tackle both.