Provide the ACI along with the bytecode #771

Merged
gorbak25 merged 1 commits from optionally_generate_aci into lima 2020-09-10 17:05:51 +09:00
gorbak25 commented 2020-09-10 01:35:48 +09:00 (Migrated from gitlab.com)

Hyperchains will be governed by a Sophia smart contract which needs to be called pretty often. Calling the compiler to encode/decode the call data for this smart contract is infeasible because it would introduce a nasty bottleneck in block validation/sync time. Creating an hard coded encoder/decoder for a particular contract would be inelegant and inflexible. The solution we agreed on in the HC team is to create an erlang library which given a particular json ACI creates an encoder/decoder for you(or does the encoding/decoding for you).

In order to test the upcoming helper library we will:

  • Refactor the existing core node test suite to use the ACI library
  • Introduce tests in the compiler which test compatibility of encoding/decoding call data between the compiler and library

As the core node test suite will start using the ACI helper library it would be inefficient and slow to call the compiler twice - one time for bytecode and the second time for the ACI. This PR allows the compiler to return the ACI without slowing the compilation down(I didn't measure a significant difference in compilation time)

Hyperchains will be governed by a Sophia smart contract which needs to be called pretty often. Calling the compiler to encode/decode the call data for this smart contract is infeasible because it would introduce a nasty bottleneck in block validation/sync time. Creating an hard coded encoder/decoder for a particular contract would be inelegant and inflexible. The solution we agreed on in the HC team is to create an erlang library which given a particular json ACI creates an encoder/decoder for you(or does the encoding/decoding for you). In order to test the upcoming helper library we will: - Refactor the existing core node test suite to use the ACI library - Introduce tests in the compiler which test compatibility of encoding/decoding call data between the compiler and library As the core node test suite will start using the ACI helper library it would be inefficient and slow to call the compiler twice - one time for bytecode and the second time for the ACI. This PR allows the compiler to return the ACI without slowing the compilation down(I didn't measure a significant difference in compilation time)
zxq9 commented 2020-09-10 16:02:13 +09:00 (Migrated from gitlab.com)

Created by: UlfNorell

Review: Approved

*Created by: UlfNorell* **Review:** Approved
zxq9 commented 2020-09-10 16:02:39 +09:00 (Migrated from gitlab.com)

Created by: hanssv

Review: Approved

*Created by: hanssv* **Review:** Approved
zxq9 commented 2020-09-10 16:16:24 +09:00 (Migrated from gitlab.com)

Created by: erlmachinedev

Review: Approved

*Created by: erlmachinedev* **Review:** Approved
zxq9 commented 2020-09-10 17:05:51 +09:00 (Migrated from gitlab.com)

Merged by: gorbak25 at 2020-09-10 08:05:51 UTC

*Merged by: gorbak25 at 2020-09-10 08:05:51 UTC*
Sign in to join this conversation.
No description provided.