# Versions increases in dynamic fields

**URL:** <https://forums.sui.io/t/versions-increases-in-dynamic-fields/2096>\
**Category:** Technical Support\
**Created:** [January 8, 2023, 12:45am UTC](https://forums.sui.io/t/versions-increases-in-dynamic-fields/2096 "2023-01-08T00:45:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shb](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@shb](https://forums.sui.io/u/shb)\
**Post date:** [January 8, 2023, 12:45am UTC](https://forums.sui.io/t/versions-increases-in-dynamic-fields/2096/1 "2023-01-08T00:45:10Z")

</div>

This question is originally from fastfrank in the Suinami Riders group:

Should the version number change on a base object each time I add either a DynamicField or DynamicObjectField?  
I’m observing it is not changing:

1. I have published a package which creates the initial base object 0x62e58282777c47ba949b947973a04ebd401b17ff (herein as A)
2. I call an entry point that adds a DynamicField and changes a bool in A resulting in A`
3. I make a second call to entry point that adds a DynamicObjectField and changes a different bool in A resulting in A``  
But A is always the same version if I walk through this object in explorer AND if I check the effects/event using RPC sui\_getTransaction

Is this working as designed?

---

<div class="post-metadata">

**Author:** ![shb](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@shb](https://forums.sui.io/u/shb)\
**Post date:** [January 8, 2023, 1:37am UTC](https://forums.sui.io/t/versions-increases-in-dynamic-fields/2096/2 "2023-01-08T01:37:14Z")

</div>

A mutable object’s version should increase every time it appears as a transaction input.

I suspect what you are observing here (at least in the explorer) is that the explorer does not maintain historical object versions, so if you look at the transaction that creates `0x62e58282777c47ba949b947973a04ebd401b17ff` ([Sui Explorer](https://explorer.sui.io/transaction/DQJtT2zNggi1LiYyoBo8RQShQGcnUmLbtXd5nu9kuWsw)), see `0x62..` in “Created”, then click the link, it will jump to the latest copy of `0x62` rather than the historical copy.

However, if I query for the original transaction, I see a different version for `0x62`:

```auto
curl --location --request POST 'https://fullnode.devnet.sui.io' \
--header 'Content-Type: application/json' \
--header 'Cookie: _cfuvid=1CO5QxX7JebZyeQyA7pxWfuFoyX62WygHNaefaCSh.w-1668403826989-0-604800000' \
--data-raw '{
    "jsonrpc":"2.0",
    "id":1,
    "method":"sui_getTransaction",
    "params":["DQJtT2zNggi1LiYyoBo8RQShQGcnUmLbtXd5nu9kuWsw"]
}' | jq
<snip>
"created": [
        {
          "owner": {
            "AddressOwner": "0x3bcadcc8a78ec44b8765ed8a8517b82a9ee310ad"
          },
          "reference": {
            "objectId": "0x62e58282777c47ba949b947973a04ebd401b17ff",
            "version": 13,
            "digest": "0kj6l8JEAcR0occZ1OBoFqbCUEmfKArHuxeasrVoHE4="
          }
        },
<snip>

```

Similarly, if I look at the tx that adds the dynamic field ([Sui Explorer](https://explorer.sui.io/transaction/3PudGqH9Lco8GDyr4PEumqf2QoEPBXrky6ur7im4JHFh)), I see a version of 14 in the output:

```auto
curl --location --request POST 'https://fullnode.devnet.sui.io' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc":"2.0",
    "id":1,
    "method":"sui_getTransaction",
    "params":["3PudGqH9Lco8GDyr4PEumqf2QoEPBXrky6ur7im4JHFh"]
}' | jq
<snip>
"mutated": [
          "owner": {
            "AddressOwner": "0x3bcadcc8a78ec44b8765ed8a8517b82a9ee310ad"
          },
          "reference": {
            "objectId": "0x62e58282777c47ba949b947973a04ebd401b17ff",
            "version": 14,
            "digest": "YEHYg5v7GHWUo9AZRewUXQK9k/Z9jUtOCH+Za7uDGn0="
          }
        }
      ],
<snip>

```

---

<div class="post-metadata">

**Author:** ![fastfrank](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/fastfrank/32/1138_2.png) [@fastfrank](https://forums.sui.io/u/fastfrank)\
**Post date:** [January 8, 2023, 10:08am UTC](https://forums.sui.io/t/versions-increases-in-dynamic-fields/2096/3 "2023-01-08T10:08:41Z")

</div>

Hi - Just to be certain we are on the same page. I am attempting to walk through the history of an object. First I do a `sui_getObject` on `"0x62e58282777c47ba949b947973a04ebd401b17ff"` which produces:

```json
{
  "data": {
    "has_public_transfer": false,
    "fields": {
      "count_accounts": "0",
      "has_child_field": true,
      "has_child_object_field": true,
      "id": "0x62e58282777c47ba949b947973a04ebd401b17ff",
      "initialized": true
    },
    "dataType": "moveObject",
    "type": "0xe43b79b5b81bbb9dfd6203425e109b04cea2be65::base::ServiceTracker",
    "type_arg": ""
  },
  "owner": {
    "owner_type": "AddressOwner",
    "owner": "0x3bcadcc8a78ec44b8765ed8a8517b82a9ee310ad"
  },
  "reference": {
    "objectId": "0x62e58282777c47ba949b947973a04ebd401b17ff",
    "version": 15,
    "digest": "CbGd3IF2gcInkdzS/v0TEnWDyIBvmywylUq5mwcPaKc="
  },
  "storageRebate": 14,
  "previousTransaction": "2soi3dxM67mZLsxRFiAiweMynhKw49ugwKhVtE9oUYFm"
}

```

Taking the above `preivousTransaction` I use it as parameter to `sui_getTransaction`. In the result of this call I expect to see an earlier version somewhere. However; all references:

In `effects->events`:

```json
{
        "mutateObject": {
          "packageId": "0xe43b79b5b81bbb9dfd6203425e109b04cea2be65",
          "transactionModule": "base",
          "sender": "0x3bcadcc8a78ec44b8765ed8a8517b82a9ee310ad",
          "objectType": "0xe43b79b5b81bbb9dfd6203425e109b04cea2be65::base::ServiceTracker",
          "objectId": "0x62e58282777c47ba949b947973a04ebd401b17ff",
          "version": 15
        }
      },

```

Note that it is still `version 15` as is the current version. I would have thought this would be 14 which was before the transaction changes.

I also find it in the tx results of the effect-\>mutated info:

```json
"mutated": [
      {
        "reference": {
          "objectId": "0x62e58282777c47ba949b947973a04ebd401b17ff",
          "version": 15,
          "digest": "CbGd3IF2gcInkdzS/v0TEnWDyIBvmywylUq5mwcPaKc="
        },
        "owner": "0x3bcadcc8a78ec44b8765ed8a8517b82a9ee310ad"
      }
    ]

```

Still at version 15.

Had there been a version difference, I would have used the earlier version to do a `sui_tryGetPastObject` and repeat the process to walk back in time for an object generation trace.

---

<div class="post-metadata">

**Author:** ![shb](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@shb](https://forums.sui.io/u/shb)\
**Post date:** [January 9, 2023, 4:52pm UTC](https://forums.sui.io/t/versions-increases-in-dynamic-fields/2096/4 "2023-01-09T16:52:31Z")

</div>

Thanks @fastfrank01! I think I see what’s going on. In short, I think the problem is that it’s not working because [JSON RPC Docs | Sui Docs](https://docs.sui.io/sui-jsonrpc#sui_getTransaction) does not show you the initial versions of object inputs to a MoveCall tx (which you need to know for your history fetching), even though this information is available to the full node. We sent [[json] Add modified\_at\_versions to SuiTransactionEffects by tnowacki · Pull Request #7237 · MystenLabs/sui · GitHub](https://github.com/MystenLabs/sui/pull/7237) to fix this.
