Skip to content

Node allows to deploy contract that can never be invoked/retrieved from storage #2829

@roman-khimov

Description

@roman-khimov

Describe the bug
This transaction:
https://dora.coz.io/transaction/neo3/mainnet/0x154f30d743c97d22fb17c5d363040ac4c9d351a1068b77b3ca6a71f91dfdcfc1

deploys (updates, but this is irrelevant) a contract with a huge manifest (605 methods). It's saved correctly in the ContractManagement state, but it's impossible to get this contract's state:

$ curl -d '{ "jsonrpc": "2.0", "id": 5, "method": "getcontractstate", "params": ["6f1837723768f27a6f6a14452977e3e0e264f2cc"] }' http://seed4.neo.org:10332 
{"jsonrpc":"2.0","id":5,"error":{"code":-32602,"message":"Invalid params"}}

or invoke it:

$ ./bin/neo-go contract testinvokefunction -r http://seed4.neo.org:10332 6f1837723768f27a6f6a14452977e3e0e264f2cc a0
Warning: FAULT VM state returned from the RPC node: One of the identified items was in an invalid format.

Expected behavior
Either we have a contract that can be interacted with or the deployment should have failed.

Platform:

  • OS: any
  • Version: 3.4.0

(Optional) Additional context
Contract's manifest has too many elements when it's converted to stack item, this is not checked during conversion/saving, but when it's retrieved from the storage deserialization fails because of the number of elements. I'd say 0x154f30d743c97d22fb17c5d363040ac4c9d351a1068b77b3ca6a71f91dfdcfc1 transaction should have failed and this manifest should've been rejected. Refs. nspcc-dev/neo-go#2801.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions