-
Notifications
You must be signed in to change notification settings - Fork 0
AP-763: Remove redundant imports related to AccountsCreateEndowment
+ fix pragma version
#386
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this falls into the class of changes we decided we wouldn't make. Is there a reason you included them? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was the only way I managed to solve both:
Regarding the latter, because this is neither a state change nor a logic change (and is thus not covered by the colored graph), I created a PR for you guys to review and say whether the changes are worth including in the code base. I should've put this rationale in the description, sorry about that. @stevieraykatz @SovereignAndrey do you think import removal is also to be avoided (the "grey" part of the graph)? AFAIK it doesn't affect neither state nor logic, it just reduces the compiled contract bytecode. It's also not significant enough to warrant an immediate contract redeployment and if/when it becomes necessary to redeploy a contract for whatever significant change we make to it (a contract that was at some point affected by import removal), there wouldn't be any (un)predictable side-effects. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stevieraykatz @misicnenad I only can speak to Cosmos in that this sort of change, removing unused imports is a change we could make, but not a critical one, so long as nothing from State was affected and it doesn't inadvertently break some referring contract. This seems to be the case here. That said, I'm in no rush to get this on mainnet. If and when we're ready to upgrade the Accounts for something more critical, I think it's worth pushing these changes along with it, since it solves the verification issues and unblocks the SDK generation for CreateEndowment facet, makes the overall contract footprint smaller & less gas expenditures. If we decided to merge this, we should test migration of the current version of Accounts contracts to this version on local/testnet for sure. After extensive checks we might feel comfortable enough to push mainnet or as mentioned just wait for some more pressing accounts fix to make the push. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stevieraykatz @SovereignAndrey maybe a "compromise" solution would be to:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @misicnenad I think your "compromise" suggested here is sound. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the delay here y'all. I agree wiht @misicnenad 's plan. The import changes can be "cut" into the existing contracts as we redeploy them for other reasons; i.e. we aren't going to plan to update them strictly for these changes. The only exception is |
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.
Turns out Tenderly and/or Polygonscan can compile their own version of the contract submitted for verification.
Fixing pragma version in place ensured that neither of them are able to use a compiler version different from the original.
The weirdest thing is that this compiler mismatch issue occurs randomly - for example the original
AccountsCreateEndowment
wasn't verifiable at all due to this error, but a slight modification would make it so, after which another modification would make it not so etc.Even changes in this PR were causing the same issue to appear, but locking the pragma made it go away.
For more details see https://swcregistry.io/docs/SWC-103/#remediation
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.
@stevieraykatz @SovereignAndrey we don't have to do this for other contracts for now, but if verification fails for any of them, this might be the culprit
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.
Glad it was easy to diagnose. I find it quite strange that polyscan/tenderly might use another compiler version when the later version 0.8.20+ are all unsupported by Polygon... -___-
Good find and good change
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.
@stevieraykatz
I found the official docs that confirm that it's recommended to use <=0.8.19, but it might not mean that later versions can't be used at all to compile contracts 🤔 Maybe leaving pragma open makes these polygonscan/tenderly compilers able to use later Solidity versions nonetheless
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.
The Alchemy RPCs straight up reject contracts on later versions! Though that might just be a nice feature and not reflected in other RPC validation steps.