rooch-network / rooch

VApp Container with Move Language for Bitcoin ecosystem
https://rooch.network
Apache License 2.0
162 stars 85 forks source link

[ObjectRuntime] ObjectChange value is null and fields are empty #2657

Closed jolestar closed 2 days ago

jolestar commented 1 month ago

Rooch version

v0.7.2

What did you do?

Add fields to a table, then remove the fields in the same transaction.

What did you see happen?

The transaction changeset contains ObjectChange:

value is null and fields are empty

 {
          "metadata": {
            "id": "0x929cac47a35d328af9bb64235cbb38b4a45849b28af91836f32f227fd0145d46",
            "owner": "rooch1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqhxqaen",
            "owner_bitcoin_address": null,
            "flag": 0,
            "state_root": "0x5350415253455f4d45524b4c455f504c414345484f4c4445525f484153480000",
            "size": "0",
            "created_at": "0",
            "updated_at": "0",
            "object_type": "0x2::table::TablePlaceholder"
          },
          "value": null,
          "fields": []
        },

What did you expect to see?

The debug_assert should not panic.

https://github.com/rooch-network/rooch/blob/0c15e337c9c3d4b9ef8efff932124f504f246592/crates/rooch-rpc-api/src/jsonrpc_types/state_view.rs#L505-L507

jolestar commented 1 week ago

@pause125 help to figure out this issue.