-
Notifications
You must be signed in to change notification settings - Fork 686
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
Adjust create account fee in Sharding #319
Adjust create account fee in Sharding #319
Conversation
f41b494
to
e8c0aef
Compare
Rebased and seems like |
IMO bad idea. The reason is that the code hash, node and balance still share ~90% of their Merkle tree branch, so it's most practical to consider it as a single item. So I'd prefer keeping the cost of 25000 for state changes that make accounts nonempty for the first time. |
Then I think this one is good to go. |
What was wrong?
Since
FlatTrieBackend
Binary Trie
is adopted in Sharding,
touch_account
doesn't seem to be needed because account'scode_hash
,balance
andnonce
now belongs to different trie entries. Also, initializing these attributes tob''
has no effect in aBinary Trie
.How was it fixed?
removesolved in Fix transaction execution #313touch_account
called inShardingComputation.apply_message
However since we no longer create a new account like we used to, we should not charge
create_gas_fee
but instead (1)separately charge for settingcode_hash
,nonce
andbalance
if not been set before. Or (2)we still charge it but multiply it by x(say 3 since there will be 3 trie entries for one account, but I'm not sure that's all the reason it's charged25000
gas for creating a new account).At first thought there doesn't seem to be an easy and clean way to charge separately so I personally would prefer (2).
Cute Animal Picture