Switch access key allowance to number of transactions #164
Replies: 3 comments 6 replies
-
This doesn't work well when there is congestion. Measuring allowance in number of transactions defies the change in gas price, which means that the total gas cost that can be spent (measured in NEAR) by a single access key is not bounded |
Beta Was this translation helpful? Give feedback.
-
I feel the current allowance makes sense, it means the app can consume at most 0.25 NEAR for function calls. What needs to change is a near-api-js handling of out of allowance error. I've added this logic to berry cards front-end and also the out of prepaid gas error retrying here (that happens for AVL rebalancing): https://github.com/evgenykuzyakov/berry-hot/blob/119f8eebb719d2282e0c753bdd072363850639c2/frontend/src/pages/Home.js#L42-L61 |
Beta Was this translation helpful? Give feedback.
-
Linkdrop has a better fix now (described in the repo).
But the issue here is pretty general. We are going to be using AccessKeys
more as an onboarding tool. So making sure they work predictably is
important.
…On Thu, Mar 4, 2021 at 4:19 PM Evgeny Kuzyakov ***@***.***> wrote:
Well I think we should just add a way to reclaim the linkdrop by the
sender. It's how amazon gift cards work. You can reclaim the gift card
you've sent if until the receiver doesn't claim it.
Then we can decrease the allowance and if the allocation gets locked due
to low allowance, then the owner can send a new one. Once we have a
congestion issue on the network, we can figure out other options.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#164 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABK27WNMCGBCXBPDMYRJKLTCAPSDANCNFSM4YQJIABA>
.
--
Best regards,
Illia Polosukhin
|
Beta Was this translation helpful? Give feedback.
-
Currently access key allowance is measured in the NEAR.
This is really weird, as it doesn't really provide any guidance on how much that can be used for.
Also given a massive amount of NEAR that must be attached when transaction is getting dispatched (64x of the actual amount most of the times), this makes this allowance almost useless / prohibitive for actual protection purposes.
Not counting that if gas price increases, the allowance will start make even less sense.
Allowance really is to define how many transactions can this user issue, so why don't we switch to that? Just keep count of how many more tx can this key dispatch in the allowance field.
We will need to figure out migration process but that shouldn't be super complex (divide allowance by 50Tg * current gas price) as it's expected that if keys have non 0 allowance there should be way to reset it.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions