Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Event Attributes #445

Closed
ghost opened this issue Mar 9, 2021 · 4 comments
Closed

Duplicate Event Attributes #445

ghost opened this issue Mar 9, 2021 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ghost
Copy link

ghost commented Mar 9, 2021

Problem

When submitting a transaction that is executed by either the init or handle function in a smart contract, when events are emitted, attributes are duplicated. This happens for all event types except message. This only happens during smart contract transactions. No dup events are produced when calling blockchain modules directly via RPC or CLI.

wasmd version = v0.15.1 ; See here

Example

See here as an example of the steps to demonstrate this issue.

Simply storing then instantiating the above integration test contract will produce the following output.

{
  "height": "17",
  "txhash": "9B84C4DE0C8582DE5D6B10AC227EECA57C0ACA1EDB9F6DC9BE80C44C8658039F",
  "codespace": "",
  "code": 0,
  "data": "0A3A0A0B696E7374616E7469617465122B0A2974703138766438667077787A636B3933716C776768616A3661726834703763356E383978386B736B7A",
  "raw_log": "[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"instantiate\"},{\"key\":\"module\",\"value\":\"wasm\"},{\"key\":\"signer\",\"value\":\"tp1f2ecech5swn8na2scfdxshhqjpapgdcq9dywh0\"},{\"key\":\"code_id\",\"value\":\"1\"},{\"key\":\"contract_address\",\"value\":\"tp18vd8fpwxzck93qlwghaj6arh4p7c5n89x8kskz\"}]},{\"type\":\"name_bound\",\"attributes\":[{\"key\":\"address\",\"value\":\"tp18vd8fpwxzck93qlwghaj6arh4p7c5n89x8kskz\"},{\"key\":\"name\",\"value\":\"name-itv2.sc.pb\"},{\"key\":\"address\",\"value\":\"tp18vd8fpwxzck93qlwghaj6arh4p7c5n89x8kskz\"},{\"key\":\"name\",\"value\":\"name-itv2.sc.pb\"}]},{\"type\":\"wasm\",\"attributes\":[{\"key\":\"contract_address\",\"value\":\"tp18vd8fpwxzck93qlwghaj6arh4p7c5n89x8kskz\"},{\"key\":\"integration_test\",\"value\":\"v2\"},{\"key\":\"action\",\"value\":\"provwasm.contracts.name.init\"},{\"key\":\"contract_name\",\"value\":\"name-itv2.sc.pb\"},{\"key\":\"contract_owner\",\"value\":\"tp1f2ecech5swn8na2scfdxshhqjpapgdcq9dywh0\"},{\"key\":\"contract_address\",\"value\":\"tp18vd8fpwxzck93qlwghaj6arh4p7c5n89x8kskz\"},{\"key\":\"integration_test\",\"value\":\"v2\"},{\"key\":\"action\",\"value\":\"provwasm.contracts.name.init\"},{\"key\":\"contract_name\",\"value\":\"name-itv2.sc.pb\"},{\"key\":\"contract_owner\",\"value\":\"tp1f2ecech5swn8na2scfdxshhqjpapgdcq9dywh0\"}]}]}]",
  "logs": [
    {
      "msg_index": 0,
      "log": "",
      "events": [
        {
          "type": "message",
          "attributes": [
            {
              "key": "action",
              "value": "instantiate"
            },
            {
              "key": "module",
              "value": "wasm"
            },
            {
              "key": "signer",
              "value": "tp1f2ecech5swn8na2scfdxshhqjpapgdcq9dywh0"
            },
            {
              "key": "code_id",
              "value": "1"
            },
            {
              "key": "contract_address",
              "value": "tp18vd8fpwxzck93qlwghaj6arh4p7c5n89x8kskz"
            }
          ]
        },
        {
          "type": "name_bound",
          "attributes": [
            {
              "key": "address",
              "value": "tp18vd8fpwxzck93qlwghaj6arh4p7c5n89x8kskz"
            },
            {
              "key": "name",
              "value": "name-itv2.sc.pb"
            },
            {
              "key": "address",
              "value": "tp18vd8fpwxzck93qlwghaj6arh4p7c5n89x8kskz"
            },
            {
              "key": "name",
              "value": "name-itv2.sc.pb"
            }
          ]
        },
        {
          "type": "wasm",
          "attributes": [
            {
              "key": "contract_address",
              "value": "tp18vd8fpwxzck93qlwghaj6arh4p7c5n89x8kskz"
            },
            {
              "key": "integration_test",
              "value": "v2"
            },
            {
              "key": "action",
              "value": "provwasm.contracts.name.init"
            },
            {
              "key": "contract_name",
              "value": "name-itv2.sc.pb"
            },
            {
              "key": "contract_owner",
              "value": "tp1f2ecech5swn8na2scfdxshhqjpapgdcq9dywh0"
            },
            {
              "key": "contract_address",
              "value": "tp18vd8fpwxzck93qlwghaj6arh4p7c5n89x8kskz"
            },
            {
              "key": "integration_test",
              "value": "v2"
            },
            {
              "key": "action",
              "value": "provwasm.contracts.name.init"
            },
            {
              "key": "contract_name",
              "value": "name-itv2.sc.pb"
            },
            {
              "key": "contract_owner",
              "value": "tp1f2ecech5swn8na2scfdxshhqjpapgdcq9dywh0"
            }
          ]
        }
      ]
    }
  ],
  "info": "",
  "gas_wanted": "149128",
  "gas_used": "147619",
  "tx": null,
  "timestamp": ""
}

It can be seen that the attributes have been duplicated for both our custom blockchain module (type name_bound), as well as those attributes emitted by the integration test smart contract (type wasm).

@ethanfrey ethanfrey mentioned this issue Mar 9, 2021
11 tasks
@alpe alpe added this to the v0.17.0 milestone Mar 10, 2021
@alpe alpe added the bug Something isn't working label Mar 10, 2021
@ghost
Copy link
Author

ghost commented May 3, 2021

It seems that with the release of wasmd v0.16.0, we're no longer seeing dup events in Provenance for our smart contracts. Unsure if this is related to our updates or wasmd updates, but it seems this is no longer an issue. Feel free to close unless you'd like to investigate further.

@ethanfrey
Copy link
Member

Yeah, there were a lot of fixes in wasmd 0.16. I assume this one was intentionally fixed, just not closed on the issue.

@alpe you meant to do this, right? Want to close?

@alpe alpe self-assigned this May 5, 2021
@alpe
Copy link
Contributor

alpe commented May 5, 2021

This still needs to be fixed but it did not make it into v0.16.0. We also have #448 which seems to be related

@alpe alpe removed their assignment May 5, 2021
@alpe alpe self-assigned this Jun 4, 2021
@alpe
Copy link
Contributor

alpe commented Jun 7, 2021

I have watched some events on init and can not see or replicate the issue.
Closing this now.

@alpe alpe closed this as completed Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants