-
Notifications
You must be signed in to change notification settings - Fork 671
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
Feat: update pessimistic cost estimator to differentiate by contract sender #2984
Conversation
So you are adding the address of the user calling the contract? What motivates this change? What problem is it solving and what data suggests it is working? |
Codecov Report
@@ Coverage Diff @@
## develop #2984 +/- ##
===========================================
- Coverage 82.79% 82.63% -0.16%
===========================================
Files 235 237 +2
Lines 190437 193149 +2712
===========================================
+ Hits 157672 159616 +1944
- Misses 32765 33533 +768
Continue to review full report at Codecov.
|
No -- this is the contract publisher address.
Without differentiating by contract publisher, two contracts with the same name, but different publishers, would share an estimate, even though the contracts are actually different contracts. This isn't rooted in data, but it is definitely incorrect behavior (which is why this is isn't necessarily a hotfix), and the added unit test demonstrates the correct behavior (separation between different contracts). |
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.
Oh I see. yes this would seem to be a logical bug.
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.
lgtm!
This change adds a field to the pessimistic cost estimator's lookup key. It doesn't change the table schema, so it's compatible with existing cost estimator tables, though it will end up resetting cost estimates. This change allows the cost estimator to differentiate between contracts with different contract senders. In most respects, this PR is a fix for incorrect behavior on the part of the pessimistic estimator, but I'm not sure this rises to the level of necessitating a hotfix, as the cost estimator's current behavior still allows miners to progress the network, albeit slightly less efficiently. If necessary, though, this could be rebased as a hotfix very easily (the patch is essentially a one line change).