Jorge-Lopes / KREAd

KREAd is an application that uses and implements composable NFTs on Agoric, the application allows users to customize their own characters by equipping and unequipping items.
Apache License 2.0
0 stars 0 forks source link

KREAd frontend should remove legacy queries #4

Open otoole-brendan opened 6 months ago

otoole-brendan commented 6 months ago

Description

Creating this issue in Kread repo to match https://github.com/Agoric/agoric-sdk/issues/9145

In the upcoming agoric-upgrade-16, we plan to upgrade our cosmos-sdk major version to 0.47. This version of cosmos-sdk removes support for "legacy queries", which had been deprecated since version 0.45. Our codebase originally demonstrated use of legacy queries as the mechanism for reading "vstorage", and this pattern had been copied by some versions of the KREAd frontend code.

Proposed Solution

Proposed Solution The Kryha/KREAd frontend appear to have eliminated legacy queries on at least recent version of the development branch. However, we are uncertain if that is the version currently running in production. This ticket is to ensure that the public-facing KREAd frontend does not use legacy queries, whether that involves development, deployment, or if it's already done this ticket can be closed. See https://github.com/Agoric/agoric-sdk/issues/9096 for more information on legacy queries and how to switch to alternative query methods.

Acceptance criteria

Confirmation legacy queries not used

Additional info

No response

Jorge-Lopes commented 6 months ago

Conclusion

The current state of KREAd running in production, commit 1f281a83b1bdf374a5bf11358c537829da614508 , the agoric/rpc pkg being imported has the version "^0.6.0", package.json. This confirms that the KREAd version running in production still uses legacy queries.

Note: the same is true for the develop branch, package.json.

Context

At the PR #40 , were the rpc pkg is upgraded to version 0.6.0 , the ChainStorageWatcher executes a method used to query the vstorage called batchVstorageQuery, where we can see that the structure passed as option to the fetch method is the same as described as legacy queries on the issue #9096

  const options = {
    method: 'POST',
    body: JSON.stringify(
      paths.map((path, index) => ({
        jsonrpc: '2.0',
        id: index,
        method: 'abci_query',
        params: { path: `/custom/vstorage/${path[0]}/${path[1]}` },
      })),
    ),
  };

Source

On the PR #55 the batchVstorageQuery is update to use the JSON API instead of the deprecated RPC method.

On the PR #65, the batchQuery file is replaced with vstorageQuery , which still use the expected JSON API to execute the queries. This feature is present from the @agoric/rpc version: 0.7.2 and forward.

The latest version is 0.9.0