Daohub-io / cap9

Capability-based security protocol for smart contracts
Apache License 2.0
22 stars 10 forks source link

Restructure modules and factor out serialization/deserialization #170

Closed JakeOShannessy closed 5 years ago

JakeOShannessy commented 5 years ago

Currently the Serialization/Deserialization traits for syscalls are pulled in from the validator crate, which is not a good layout. We also need to evaluate where serialization and decoding are used and make sure everything is consistent.

JakeOShannessy commented 5 years ago

Regarding mixing Serialization/Deserialization with the Ethereum ABI, I think we can consider them quite separate. The way Serialization/Deserialization is used is completely internal and separate from the ABI. I think it would be wrong to try and make the eth-abi support what we want to support here. The ABI is purely about external interaction with a contract.

I think the more important question is around to_u256_list etc. used by Capability. This is currently specific to capabilities, and cannot be used by syscalls (because Caps are U256 based, but syscalls need byte-level control).

I think we wait until a stable point and reevaluate what can/cannot be shared where.

Latrasis commented 5 years ago

Agree. The #to_u256_list method is more or less a dirty interface that was done adhoc, so it's likely to be changed.

JakeOShannessy commented 5 years ago

This is partially #176, except that serialisation has not been completed yet.

JakeOShannessy commented 5 years ago

Can be considered complete with #176.