aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

refactor: deprecate JSON interface from SDK

Open jjleng opened this issue 3 years ago • 1 comments

Description

We should deprecate the JSON interface for transaction submission. Submitting transactions in JSON would require the server to generate signing messages, which is not safe. Transactions submissions should be done through the BCS interface.

This PR added @deprecated tag to the JSON interfaces. Developers have visual indications in IDE. We are going to remove these interfaces in next major release.

Test Plan

All the tests still pass.


This change is Reviewable

jjleng avatar Jul 30 '22 05:07 jjleng

Deprecating this makes me a bit sad... The existing BCS interface is still pretty raw and rough; is there a world where instead we add an endpoint to the node that returns a json representation of the method ABI instead, and locally convert to BCS based on that + sign? I.e a method that accepts the ABI for local conversion/signing, alternatively with fallback to a FN/indexer?

CapCap avatar Jul 30 '22 21:07 CapCap

@CapCap thanks for sharing your concerns. This PR won't get landed. But it is still worth explaining what we are doing on the SDK side. This PR only deprecates that JSON txn submission. For txn submission, we now have ABI support. Although we have endpoints to return the ABI in JSON format for methods, we followed the Eth web3 approach. We ask users to provide ABI on the client side. Users get ABIs through compiling Move.

For the read path, we are not deprecating the JSON payloads. The BCS payload reading and decoding are still a work in progress.

jjleng avatar Aug 01 '22 17:08 jjleng

This is not relevant any more because of the massive refactoring

jjleng avatar Aug 03 '22 23:08 jjleng