lambdaclass/zksync_era_precompiles

Trying to test gast costs for an input for modexp but compiler fails on `make run`

Closed this issue · 6 comments

Hi,

Trying to test the gas cost of the following input to modexp:

0x0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000x00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000010080bb4ada562d33b39294c2028ed837ea6cfd537d69f5ffab2a2673fdd4ec4893913b2b2b4bdf05cf3b51a4a97094ec5252f257201041f7966155669da70b2c800657124ae1d9c44534429c88f5f943c688d399d2f91a581f1b89abaa4d0d6ff4e68ebf7c281f04fdf6e3ea039d07fabccb3523c06cdc5ad8b364d41b1eedafe536661666a11952970ac244601eb77355b28a2f44d75ae4ade502919accb5fd0de70db6b2416ad83f68cdd4d874720738e8eae21b703617eacaab0382faa68066f90474374a1fa409b7074c554721277cca168b193ca32a808f67d73ff049e9761fe7cbb2cc22fdc26c620aed1694db023b997f6d104e7663b9ebc84bba79a377010001cab2293271d8ad53f095b0be218f1a53643a40a9cb7ffa751505cd8933bd99615d7985cfe1c345e90296832e236d54ab3acfb8a8b65b2b046f6617d3bae296e9fc23e6555970db2ae5d77a19747ae48f24c2898c1fe66ffe90edf732e28890a9e7f194e8a95bf33318fe3104d5f669f3c1c8936722e06ae6b4f4dbc3c2c70249f43f9e2c410aa60adcea016a7caa467e1863484f1308750318db6e645fb0f1f75aee09bdba8cf0af179b8eac74fe23aac553d7d96c8827e13f4fb61aeeb9b6d40aeb4a211f892bc07b7637fad5ff044ee2a899a1d56c273103e43bc43d03109cde44caa23eb95bf6726ccd98e6a7f56c0a1a10420fb09748c53fed51ca0b31f00000000000000000000000000000000010080bb4ada562d33b39294c2028ed837ea6cfd537d69f5ffab2a2673fdd4ec4893913b2b2b4bdf05cf3b51a4a97094ec5252f257201041f7966155669da70b2c800657124ae1d9c44534429c88f5f943c688d399d2f91a581f1b89abaa4d0d6ff4e68ebf7c281f04fdf6e3ea039d07fabccb3523c06cdc5ad8b364d41b1eedafe536661666a11952970ac244601eb77355b28a2f44d75ae4ade502919accb5fd0de70db6b2416ad83f68cdd4d874720738e8eae21b703617eacaab0382faa68066f90474374a1fa409b7074c554721277cca168b193ca32a808f67d73ff049e9761fe7cbb2cc22fdc26c620aed1694db023b997f6d104e7663b9ebc84bba79a377010001cab2293271d8ad53f095b0be218f1a53643a40a9cb7ffa751505cd8933bd99615d7985cfe1c345e90296832e236d54ab3acfb8a8b65b2b046f6617d3bae296e9fc23e6555970db2ae5d77a19747ae48f24c2898c1fe66ffe90edf732e28890a9e7f194e8a95bf33318fe3104d5f669f3c1c8936722e06ae6b4f4dbc3c2c70249f43f9e2c410aa60adcea016a7caa467e1863484f1308750318db6e645fb0f1f75aee09bdba8cf0af179b8eac74fe23aac553d7d96c8827e13f4fb61aeeb9b6d40aeb4a211f892bc07b7637fad5ff044ee2a899a1d56c273103e43bc43d03109cde44caa23eb95bf6726ccd98e6a7f56c0a1a10420fb09748c53fed51ca0b31f

However, I am getting the following error on make run:

image

It would be great if someone could point me in the right direction or run the test with the input above for me.

I tried the hint in the image but I am getting other errors after it, so I don't think it is the right fix.

The input is formed from

bytes s = hex"80bb4ada562d33b39294c2028ed837ea6cfd537d69f5ffab2a2673fdd4ec4893913b2b2b4bdf05cf3b51a4a97094ec5252f257201041f7966155669da70b2c800657124ae1d9c44534429c88f5f943c688d399d2f91a581f1b89abaa4d0d6ff4e68ebf7c281f04fdf6e3ea039d07fabccb3523c06cdc5ad8b364d41b1eedafe536661666a11952970ac244601eb77355b28a2f44d75ae4ade502919accb5fd0de70db6b2416ad83f68cdd4d874720738e8eae21b703617eacaab0382faa68066f90474374a1fa409b7074c554721277cca168b193ca32a808f67d73ff049e9761fe7cbb2cc22fdc26c620aed1694db023b997f6d104e7663b9ebc84bba79a377";

bytes e = hex"010001";

bytes m =
hex"cab2293271d8ad53f095b0be218f1a53643a40a9cb7ffa751505cd8933bd99615d7985cfe1c345e90296832e236d54ab3acfb8a8b65b2b046f6617d3bae296e9fc23e6555970db2ae5d77a19747ae48f24c2898c1fe66ffe90edf732e28890a9e7f194e8a95bf33318fe3104d5f669f3c1c8936722e06ae6b4f4dbc3c2c70249f43f9e2c410aa60adcea016a7caa467e1863484f1308750318db6e645fb0f1f75aee09bdba8cf0af179b8eac74fe23aac553d7d96c8827e13f4fb61aeeb9b6d40aeb4a211f892bc07b7637fad5ff044ee2a899a1d56c273103e43bc43d03109cde44caa23eb95bf6726ccd98e6a7f56c0a1a10420fb09748c53fed51ca0b31f7";

input = bytes.concat(bytes32(_s.length), bytes32(_e.length), bytes32(_m.length), _s, _e, _m);

Hi! Glad to help, could you provide specific code/test you're running and a step-by-step for me to reproduce this behavior?

Awesome! thank you.

I cloned this repo and ran make setup followed by make run.
make run threw the compiler error I posted above.

The test I want to run is for example this one: https://github.com/lambdaclass/zksync_era_precompiles/blob/main/tests/tests/modexp_tests.rs#L10-L16.

Instead of the current string in these lines, I want to place the input in the description of the issue above.

Awesome! thank you.

I cloned this repo and ran make setup followed by make run. make run threw the compiler error I posted above.

The test I want to run is for example this one: https://github.com/lambdaclass/zksync_era_precompiles/blob/main/tests/tests/modexp_tests.rs#L10-L16.

Instead of the current string in these lines, I want to place the input in the description of the issue above.

Reproduced it, thanks for the report we'll work on it.

Thanks, in the meantime would it be possible for you to run the benchmark?

Fixed in #210