fix(deterministic-account-id): allow account creation by transfers#15007
Conversation
5588716 to
2804bb0
Compare
| if !ProtocolFeature::FixDeterministicAccountIdCreation.enabled(PROTOCOL_VERSION) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
I guess this check is not needed since PROTOCOL_VERSION is compile constant.
Maybe we can merge the tests or change to assert! if relevant.
| || (ProtocolFeature::FixDeterministicAccountIdCreation | ||
| .enabled(apply_state.current_protocol_version) | ||
| && apply_state.config.wasm_config.deterministic_account_ids | ||
| && account_id.get_account_type() == AccountType::NearDeterministicAccount)); |
There was a problem hiding this comment.
nit: maybe we can have some named bool here.
There was a problem hiding this comment.
In that way, account_id.get_account_type() method will be called and string comparison will be made regardless of whether it was actually needed or not. To save CPU I would suggest calling a function when needed instead of computing it in advance.
Having that said, this tiny optimization would not make any difference given all the other inefficiencies in the current runtime implementation 😅
| if !ProtocolFeature::DeterministicAccountIds.enabled(version_before_fix) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
seems could be assert instead
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #15007 +/- ##
===========================================
+ Coverage 1.30% 68.83% +67.53%
===========================================
Files 726 920 +194
Lines 140751 201510 +60759
Branches 140751 201510 +60759
===========================================
+ Hits 1835 138711 +136876
+ Misses 138863 56830 -82033
- Partials 53 5969 +5916
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…sfers (near#15007)" This reverts commit 122ef2d.
account_is_implicit()function, so that it returns true only if this type of implicit accounts is enabled