Conversation
|
dk1a
left a comment
There was a problem hiding this comment.
so far looks really good, I wanted to make basically the same thing and hadn't gotten to it yet. Do tell if you want me to take it off your hands or if u wanna finish it urself
|
|
||
| return FieldLayoutLib.encode(_fieldLayout, 5); | ||
| return _fieldLayout; | ||
| } |
There was a problem hiding this comment.
do we even need getFieldLayout if we have it as a constant above and it's more gas efficient to use that? wonder if it's worth just exporting that as a named constant like we do for table ID
Internal methods skip StoreSwitch and call StoreCore directly. This reduce the gas cost by ~300 per call.
Looks like I snatched up all the low hanging fruits lol. Take over if your hands are free. I can help if you're busy with other stuff. |
encodePacked(bytes32[]) != encodePacked(bytes32, ..., bytes32) in 0.8.13
|
I think ~all of these were merged as separate smaller PRs, so closing this one! |
Pasted from discord:
Feature request: bring real world mud2 read/write gas cost to parity with sload and sstore.
Almost all of the overhead that mud2 adds on top of sload and sstore comes from computing static constants onchain.
For the current version of mud2, warm Table.get[StaticField] cost in the ballpark of 2000 + 500 * (# of fields in key schema) + 500 * (# of fields in value schema). This can probably be reduced by 90%+ to < 400 gas:
The same logic is applicable to writes.