Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

[RSA Accumulator] Reduce code size #71

Open
nrryuya opened this issue Jan 6, 2019 · 0 comments
Open

[RSA Accumulator] Reduce code size #71

nrryuya opened this issue Jan 6, 2019 · 0 comments

Comments

@nrryuya
Copy link
Member

nrryuya commented Jan 6, 2019

For now, the code (merged in #70) can't be deployed due to the excess of the code size: eth.exceptions.OutOfGas: Contract code size exceeds EIP170 limit of 24577. Got code of size: 55782

For analysis.

Suspects

  • There are a tremendous number of mstore and mload in the LLL.
    • Vyper uses them a lot to call private functions.
    • For example, the first part in the LLL of def _convertBytesArrayToUInt256List(_inp: bytes[256]) -> uint256[8]: has a sequence of 231 of mload.
                      [mload, 320],
                      [mload, 352],
                      [mload, 384],
                      [mload, 416],
                      [mload, 448],
                      [mload, 480],
                      [mload, 512],
                      [mload, 544],
                      [mload, 576],
                      [mload, 608],
                      [mload, 640],
                      [mload, 672],
# Continuing...
multiplicationResult = _primes[4 * i] * _primes[4 * i + 1] * _primes[4 * i + 2] * _primes[4 * i + 3]

Workarounds

  • Change private -> public
  • Put codes in private functions inline
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant