sui icon indicating copy to clipboard operation
sui copied to clipboard

fn: remove object IDs from transactions_to_addr index

Open gegaowp opened this issue 2 years ago • 1 comments

Description

transactions_to_addr now includes both address and object IDs. Related posts are https://mysten-labs.slack.com/archives/C04FG4Q7YJ3/p1682369162080879 https://mysten-labs.slack.com/archives/C04HS54LHUM/p1682039873458439

Test Plan

CI test run local FN + Explorer and make sure 0x5 is not showing as address any more.

gegaowp avatar Apr 25 '23 16:04 gegaowp

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Apr 25, 2023 4:30pm
explorer-storybook ⬜️ Ignored (Inspect) Apr 25, 2023 4:30pm
sui-wallet-kit ⬜️ Ignored (Inspect) Apr 25, 2023 4:30pm
wallet-adapter ⬜️ Ignored (Inspect) Apr 25, 2023 4:30pm

vercel[bot] avatar Apr 25 '23 16:04 vercel[bot]

@longbowlu great point, I will hold this PR, cherry-pick it to the latest release and build a image from there.

gegaowp avatar Apr 26 '23 22:04 gegaowp

I tested this change on testnet by

  • wipe DB on a FN
  • restart the FN with the fix on top of v1.1
  • tested via curl below, the TL;DR is that, this fix will remove all objectOwners from transactions_to_addr but cannot prevent ppl from explicitly specifying an object ID as an address. For the issue of explicitly specifying an object ID as an address, Xun had a thread https://mysten-labs.slack.com/archives/C04FG4Q7YJ3/p1683308772041359
curl --location --request POST http://ord-exp-val-01.experiments.sui.io:9000 \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_queryTransactionBlocks",
    "params": [
        {
            "filter": {
                "ToAddress": "0x0000000000000000000000000000000000000000000000000000000000000005"
            }
        },
        null,
        10,
        false
    ]
}' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   484  100   182  100   302    827   1372 --:--:-- --:--:-- --:--:--  2240
{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "digest": "Ggb1fvYqRgcQY53GxLd9CxaEN8ar9DzmrdVpzysjMfQF"
      }
    ],
    "nextCursor": "Ggb1fvYqRgcQY53GxLd9CxaEN8ar9DzmrdVpzysjMfQF",
    "hasNextPage": false
  },
  "id": 1
}

compared with another FN without the fix:

{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "digest": "Cgww1sn7XViCPSdDcAPmVcARueWuexJ8af8zD842Ff43"
      },
      {
        "digest": "ArHNaJ97CY5Vgj3yn5ysYcpubDK9HXuLsy8nqsaCrbC1"
      },
      {
        "digest": "BoeK9ZWnFurKGbc3n5VM8Sd5n7n96W5xD1biZPpvbHKz"
      },
      {
        "digest": "8yA1YE6LsDyaDnqvr4L1uXt4K9qkpw8MLzTEXD7emgj6"
      },
      {
        "digest": "46vWvNz5v2eKNDrY5xun5aUKVXrQAPU95tU2v5ovT4J4"
      },
      {
        "digest": "6eH9caQGLv6btEBWY6oUJjBYPXQCZT73pAePdoPcdTtD"
      },
      {
        "digest": "BcFJo6fq6a8BagtgTGFKZAu9FEsPisYVb2MxXvL5PTAK"
      },
      {
        "digest": "GwrtXetqb8GCQpagpt2KtGWF8L7VfNooMQrKeuL3D2oc"
      },
      {
        "digest": "GXprX6FDRKaRbRCxtGjaoNjpGq9ZKby2ZtAbxUnZdMQ6"
      },
      {
        "digest": "6P1mDDsPsE1UCNNwCKw2ofJpo1cfquRwnVS8k845hMY5"
      }
    ],
    "nextCursor": "6P1mDDsPsE1UCNNwCKw2ofJpo1cfquRwnVS8k845hMY5",
    "hasNextPage": true
  },
  "id": 1
}

cc @lxfind @longbowlu will merge this PR soon if no objections.

gegaowp avatar May 10 '23 21:05 gegaowp