Skip to content

Conversation

computerphysicslab
Copy link

@computerphysicslab computerphysicslab commented Jul 1, 2021

Script to create report on bytecodes not supported by zkSync

DistributedCollective/Sovryn-smart-contracts#285

Requires hardhat compilation of every contract.

Script results:

SOVRYN TOTAL FREQUENCIES:
EXP: 242
ADDMOD: 4
SMOD: 12
MULMOD: 3
CREATE2: 10
SELFDESTRUCT: 6

AMM TOTAL FREQUENCIES:
EXP: 3716
ADDMOD: 3
SMOD: 7
MULMOD: 7
CREATE2: 1
SELFDESTRUCT: 4

In-detail results => https://docs.google.com/spreadsheets/d/1SPeqBk7vRxKlSlvDqKycSRsxFjEGRUj9O-XMr-YMG_8/edit?usp=sharing

As an enhancement it has been researched to use sourcemap to get locations of the opcodes in the contract solidity files, but a big blocker (or a misunderstanding from my part) has been found: To a simple contract example having 100 opcodes is corresponding a sourcemap w/ only 20 semicolons, meaning 21 entries. So the number of codes and map entries differ by much. So it is useless to follow this route in order to trace opcodes to the source with code line accuracy.

@computerphysicslab computerphysicslab added the enhancement New feature or request label Jul 1, 2021
@computerphysicslab computerphysicslab requested review from a user, ororopickpocket and tjcloa July 1, 2021 10:22
@computerphysicslab computerphysicslab self-assigned this Jul 1, 2021

# Opening the JSON output from the last hardhat compilation
# f = open('artifacts/build-info/eaaf433b5af1a78be582155342f51ab5.json',)
f = open('artifacts/build-info/0202910f40424d4ba1f4d5c762daecf5.json',)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be hardcoded, please use params
and no artifacts/ should be merged

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

@tjcloa tjcloa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls remove artifacts/build-info/0202910f40424d4ba1f4d5c762daecf5.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants