Skip to content

encode command ignores additional fields in xdr instead of failing #171

@sisuresh

Description

@sisuresh

What version are you using?

stellar-xdr 20.1.0 (8b9d623ef40423a8462442b86997155f2c04d3a1)
xdr (+curr): b96148cd4acc372cc9af17b909ffe4b12c43ecb6
xdr (+next): 6a71b137bc49f901bed53c8c215c26213017026c

What did you do?

Ran stellar-xdr encode --type ConfigUpgradeSet xdr.json where xdr.json contained -

{
  "updated_entry": [
    {
      "contract_execution_lanes": {
        "ledger_max_tx_count": 100,
        "additional_setting_bad": 100
      }
    }
  ]
}

What did you expect to see?

Error message due to bad setting.

What did you see instead?

AAAAAQAAAAsAAABk (Which is the contract_execution_lanes xdr without additional_setting_bad).

This caused us some issues during the testnet reset because we added a new field to one of the settings and updated our JSON file, but my local stellar-xdr was out of date, so the encode command was just ignoring the new field instead of failing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions