adm/morph: Fix transfer GAS to alphabet nodes #1239

Merged
fyrchik merged 1 commit from achuprov/frostfs-node:bugfux/transfer_gas into master 2024-07-12 05:59:06 +00:00
Member

Ref # TrueCloudLab/frostfs-dev-env#70

1
2
Signed-off-by: Alexander Chuprov a.chuprov@yadro.com

Ref # https://git.frostfs.info/TrueCloudLab/frostfs-dev-env/pulls/70 ![1](/attachments/b34d93a5-11ad-4418-8fb8-072574c06e69) ![2](/attachments/3ea2e4c5-4ff8-4837-90b9-235591258cf1) Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
16 KiB
11 KiB
achuprov requested review from storage-core-committers 2024-07-10 21:08:34 +00:00
achuprov requested review from storage-core-developers 2024-07-10 21:08:40 +00:00
fyrchik reviewed 2024-07-11 07:28:17 +00:00
@ -81,3 +81,3 @@
r := nep17.NewReader(c.ReadOnlyInvoker, gas.Hash)
res, err := r.BalanceOf(acc.Contract.ScriptHash())
return res.Cmp(big.NewInt(initialAlphabetGASAmount/2)) == 1, err
return res.Cmp(big.NewInt(5*native.GASFactor)) == 1, err
Owner

It doesn't depend on the number of alphabet nodes (is that what we want?), how about initialAlphabetGASAmount / 100500?
Anyway, where does 5 comes from?

It doesn't depend on the number of alphabet nodes (is that what we want?), how about `initialAlphabetGASAmount / 100500`? Anyway, where does `5` comes from?
Author
Member

The initialAlphabetGASAmount is set as initialAlphabetGASAmount = 10_000 * native.GASFactor and does not depend on the number of alphabet nodes.
The coefficient of 5 was obtained empirically.

The `initialAlphabetGASAmount` is set as `initialAlphabetGASAmount = 10_000 * native.GASFactor` and does not depend on the number of alphabet nodes. The coefficient of `5` was obtained empirically.
Owner

Please, move 5 to a constant with a comment about why it is as it is.

Please, move 5 to a constant with a comment about why it is as it is.
achuprov force-pushed bugfux/transfer_gas from d52de747d9 to 782b7dfbdb 2024-07-11 15:25:26 +00:00 Compare
achuprov force-pushed bugfux/transfer_gas from 782b7dfbdb to 08953a2f94 2024-07-11 15:28:55 +00:00 Compare
fyrchik approved these changes 2024-07-12 04:21:34 +00:00
acid-ant approved these changes 2024-07-12 05:54:48 +00:00
fyrchik merged commit 08953a2f94 into master 2024-07-12 05:59:06 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1239
No description provided.