-
Notifications
You must be signed in to change notification settings - Fork 0
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
QA Report #544
Comments
9 l 4 r 20 nc [QA-1] Unsafe addition in unchecked block may overflow in NonceHolder.sol [QA-2] Missing checks for address(0) when updating address state variables [QA-3] Consider adding address verifyingContract to EIP721_DOMAIN_TYPEHASH in TransactionHelper.sol [QA-4] Violation of EIP-712 in TransactionHelper.sol [QA-5] Functions in Governance.sol do not check if new values are the same as current state [QA-6] Incorrect type of blockGasLimit in SystemContext.sol [QA-7] L1ERC20Bridge won't work with rebasing tokens [QA-8] getZkSyncMeta() from SystemContractHelper.sol does not include some fields from ZkSyncMeta [QA-9] Lack of cleaning of variables before call in inline assembler [QA-10] Lack of 0-value check in NonceHolder.sol [QA-11] processPaymasterInput() may revert for some ERC-20 tokens [QA-12] Lack of address(0) check in L2ERC20Bridge means that finalizeDeposit() will mint tokens to address(0) [QA-13] storedBatchHash() might return batch which was reverted by Executor's revertBatches() [QA-14] DiamondProxy does not check if contract exists [QA-15] Lack of input validation in AccountCodeStorage.sol may lead to overflow [QA-16] Incorrect assumption may lead to revert in _burnMsgValue() in system-contracts/contracts/L2EthToken.sol [QA-17] The current gas price might be set to 0 in SystemContext [QA-18] MsgValueSimulator ignores MAX_MSG_VALUE [N-1] In ContractDeployer.sol - ensure that new value is different than the current one [N-2] Update name of updateNonceOrdering to better reflect its usage [N-3] In NonceHolder.sol - function getRawNonce() can be used inside more functions [N-4] Unused code / code for local testing should be removed [N-5] ContractDeployer.sol events do not emit parameters from old values [N-6] NatSpec does not properly describes _setAllowList() in ethereum/contracts/upgrades/BaseZkSyncUpgrade.sol [N-7] Redundant check in DefaultAccount.sol [N-8] incrementDeploymentNonce() from NonceHolder.sol doubles access checks: [N-9] In NonceHolder.sol - the order of getters and setters are mixed [N-10] Incorrect comment in SystemContext about baseFee [N-11] The behavior of _markBytecodeAsPublished() may be misleading [N-12] Incorrect comment in TransactionHelper.sol [N-13] Improper NatSpec for _isValidSignature() in DefaultAccount.sol [N-14] Some functions define named returns, but still return value via return statement [N-15] Inconsistency in representing hex 0x00 [N-16] Misleading variable naming in SystemContext.sol [N-17] Constants in NonceHolder.sol does not have visibility set [N-18] Define constants, instead of using magic numbers: [N-19] Use ternary operators to make if/else statements more readable [N-20] ForceDeployment struct can be moved from ConstractDeployer.sol [N-21] Repeated checks can be implemented as modifiers [N-22] ReentrancyGuard.sol contains links to non-existing webpages [N-23] Comments are not grammatically correct: [N-24] Messages in require are not descriptive |
Hey, firstly - thank you for the access to the repo and for judging it so quickly! [QA-13] storedBatchHash() might return batch which was reverted by Executor's revertBatches()The exactly same issue was evaluated as Low in #1124 (QA-02), while my issue as Refactor. I also think, that this one should be evaluated as Low, instead of Refactor, since it's the same issue. [QA-2] Missing checks for address(0) when updating address state variablesAs mentioned in my report, this issue was not included in the bot-report, thus I've reported it here. In the bot report, I see only one "missing checks for address(0x0)" issues: L-21 (which mentions The other issue from bot report is L-20 - which reports missing checks for address(0x0) in the constructor/initializer. It does indeed report [QA-3] Consider adding address verifyingContract to EIP721_DOMAIN_TYPEHASH in TransactionHelper.solEIP-721 explicitly states, that [QA-9] Lack of cleaning of variables before call in inline assemblerSolidity docs straightforwardly mentions that "To be safe, always clear the data properly before you use it in a context where this is important". Since in all instances, the issue affects the [N-1] In ContractDeployer.sol - ensure that new value is different than the current oneI don't see this entry in the bot-report. I think it was confused with bot's N‑43 - "Events that mark critical parameter changes should contain both the old and the new value". [QA-5] Functions in Governance.sol do not check if new values are the same as current stateSame as above, bot reports that event should contain both the old and the new value. May issue states that there should be an additional check, to make sure we're not updating the same value. [N-21] Repeated checks can be implemented as modifiersI've grepped the whole bot-report section and I do not see anything which suggests it's already set in a bot report. Could you please point me out to the bot's issue? Additional questionMoreover, would this degraded report (from Medium to QA) be also included in my QA report: #614 |
Hey @GalloDaSballo I've one more additional issue related to my QA report. [QA-6] Incorrect type of blockGasLimit in SystemContext.solI've noticed, that multiple of issues were evaluated as Medium, whenever inconsistent behavior of the EVM with the zkSyncVM was demonstrated: E.g., some of your comments:
#426 (comment) #175 (comment) #174 (comment)
Since I was not aware that proving inconsistency between zkSync and EVM would be evaluated as Medium - I wrote Could you plese verify, if above issue (QA-6) should also be treated as inconsistency between EVM and zkSync and be classified as Medium? I've redesigned the structure of my finding (added Impact and Recommended Mitigation Steps, PoC remained the same and was copy-pasted from my QA Report). ImpactThe gas limit of a block defines the maximum amount of gas that all the transactions inside the block are allowed to consume. The goal of the zkSync EVM is to be the EVM compatible. This goal is not fulfilled. zkSync implementation allows for setting higher gas limit (because gas limit is defined as Proof of ConceptEVM defines
However, the current implementation of zkEVM implements File: system-contracts/contracts/SystemContext.sol#L37
There shoudn't be any inconsistency between variable datatypes. The variable type should be the same as the EVM, so Recommended Mitigation Steps
|
I disagree with the escalation for 2 reasons: |
escalation: thank you, that explanation seems fair! rest of my QA: I've missed the google docs link when I was escalating, but now I see that my report is already graded as A. Upgrading QA-6 was disputed, thus my QA score won't be affected. Therefore, please feel free to ignore the rest of my comments. If this QA is already graded as A, further escalation won't change a thing, so I don't wanna unnecessary waste judge's time! |
GalloDaSballo marked the issue as grade-a |
See the markdown file with the details of this report here.
The text was updated successfully, but these errors were encountered: