-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gas limit tweaks and EMP bytecode optimization #1356
Conversation
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
… to save bytecide, fix CalculateContractBytecode.js bug Signed-off-by: Nick Pai <npai.nyc@gmail.com>
@@ -17,6 +18,10 @@ module.exports = async function(deployer, network, accounts) { | |||
const finder = await Finder.deployed(); | |||
const tokenFactory = await TokenFactory.deployed(); | |||
|
|||
// Deploy EMPLib and link to EMPCreator. | |||
await deploy(deployer, network, ExpiringMultiPartyLib); | |||
await deployer.link(ExpiringMultiPartyLib, ExpiringMultiPartyCreator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there another example in the repo of linking libraries with contracts before deploying? I couldn't find one so I did it explicitly here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look at the TokenizedDerivativeUtils
library from before we removed it from the repo, we did the same thing there.
@nicholaspai Could you also include bytecode statistics for this new library? It'll probably be the largest IIUC. |
great point. Done. Interesting the amount of overhead a library/contract has. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great -- to be honest, my biggest worry here is that this will make bytecode verification on Etherscan more difficult.
Do libraries make it more difficult? The optimizer runs # shouldn't affect it. |
They shouldn't, but you have to plug them in manually, making the verification process slightly more complicated, so you never know :). |
Ah, should we hold off then and do a testnet deployment + verification? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! thanks for doing these optimizations. Glad we can fit all the required PRs now :)
Nah, I wouldn't worry about it. We'll cross that bridge when we come to it. |
This PR contains several features
bytecode
todeployedBytecode
inCalculateContractBytecode.js
script.createExpiringMultiParty(params)
. H/t to @mrice32 for the idea. This separates EMP bytecode on-chain from the EMP-creator, which means that the EMP-creator is no longer the bytecode bottleneck for deploying the EMP set of contracts.deployedBytecode
Statistics:This PR:
3041
bytes17170
bytes20974
bytesPrevious:
22983
bytes17170
bytesIntegrating this PR will give us the neccessary bytecode space to merge in both #1305 and #1334 . #1305 adds ~900 bytes and #1334 adds ~500 bytes. The bytecode limit is ~24,500 bytes, so we will have plenty of bytecode remaining.