Closed vaivaswatha closed 3 years ago
See commit message: https://github.com/Zilliqa/scilla-compiler/commit/b8b97d32a05b78676a4962a0f5b02b9c92041785.
In addition to explicit remote state load and map get, code must be generated for dynamic type checking. This involves:
Address
typed fields in contract parameters must be scanned and ensured that each field specified exists.Address
typed transition parameter must be first scanned and each field specified must exist.See commit message: b8b97d3.
In addition to explicit remote state load and map get, code must be generated for dynamic type checking. This involves:
- During deployment, any
Address
typed fields in contract parameters must be scanned and ensured that each field specified exists.- During transition execution, any
Address
typed transition parameter must be first scanned and each field specified must exist.
Quoting @jjcnn 's response to this on slack:
Not quite: It's any address in a contract/transition parameter, even if it's buried in a map or an ADT value. In the interpreter the work is done by
assert_literal_type
: >https://github.com/Zilliqa/scilla/blob/994b231fd1a4be37639a9ac86194296e6022946f/src/base/TypeUtil.ml#L672 It's called frominit_contract
(for deployment) andcheck_message_entries
(for transition invocation) in Eval.ml.
After a discussion with Jacob:
Address
types till LLVM code generation. Type descriptors will be extended to accommodate Address
types and the VM taught to handle and test assignability of these types. Actual code generation of Address
values can still be just as if they were ByStr20
values. It's just the type system that'll be extended.Implemented with #64, #65, #66. Closing.
https://github.com/Zilliqa/scilla/pull/967