AA-140 N-09: Stake size inconsistency [core] (#209)

* AA-140 N-09: Stake size inconsistency [core]
---------

Co-authored-by: shahafn <shahaflol@gmail.com>
This commit is contained in:
Alex Forshtat
2023-02-09 03:48:34 +04:00
committed by GitHub
parent ca1b6495f2
commit 419b7b04f9
2 changed files with 10 additions and 10 deletions

View File

@@ -63,7 +63,7 @@ abstract contract StakeManager is IStakeManager {
require(_unstakeDelaySec >= info.unstakeDelaySec, "cannot decrease unstake time");
uint256 stake = info.stake + msg.value;
require(stake > 0, "no stake specified");
require(stake < type(uint112).max, "stake overflow");
require(stake <= type(uint112).max, "stake overflow");
deposits[msg.sender] = DepositInfo(
info.deposit,
true,

View File

@@ -1,28 +1,28 @@
== gas estimate of direct calling the account's "execFromEntryPoint" method
the destination is "account.nonce()", which is known to be "hot" address used by this account
it little higher than EOA call: its an exec from entrypoint (or account owner) into account contract, verifying msg.sender and exec to target)
- gas estimate "simple" - 31033
- gas estimate "simple" - 31045
- gas estimate "big tx 5k" - 127295
╔════════════════════════════════╤═══════╤═══════════════╤════════════════╤═════════════════════╗
║ handleOps description │ count │ total gasUsed │ per UserOp gas │ per UserOp overhead ║
║ │ │ │ (delta for │ (compared to ║
║ │ │ │ one UserOp) │ account.exec()) ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple │ 1 │ 78087 │ │ ║
║ simple │ 1 │ 78111 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple - diff from previous │ 2 │ │ 43549 │ 12516
║ simple - diff from previous │ 2 │ │ 43573 │ 12528
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple │ 10 │ 470485 │ │ ║
║ simple │ 10 │ 470509 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple - diff from previous │ 11 │ │ 43720 │ 12687 ║
║ simple - diff from previous │ 11 │ │ 43732 │ 12687 ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster │ 1 │ 84411 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster with diff │ 2 │ │ 42598 │ 11565 ║
║ simple paymaster with diff │ 2 │ │ 42550 │ 11505 ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster │ 10 │ 467918 │ │ ║
║ simple paymaster │ 10 │ 467966 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster with diff │ 11 │ │ 42770 │ 11737
║ simple paymaster with diff │ 11 │ │ 42758 │ 11713 ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx 5k │ 1 │ 179846 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
@@ -30,6 +30,6 @@
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx 5k │ 10 │ 1489653 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx - diff from previous │ 11 │ │ 146391 │ 19096
║ big tx - diff from previous │ 11 │ │ 146379 │ 19084
╚════════════════════════════════╧═══════╧═══════════════╧════════════════╧═════════════════════╝