Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Increase redemption fee by a step from the two latest events #611

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

nkuba
Copy link
Member

@nkuba nkuba commented Nov 17, 2020

Deposit requires the fee to be bumped by the constant value equal to the initial redemption fee.

To obtain the initial fee we looked for the very first event, we also need the latest event. It worked fine until there were multiple fee increases and the number of blocks to reach the first event exceeded 10k that is a default limitation for getPastEvents. In such situation, the first event that was returned wasn't actually the very first event registered on-chain for the deposit.

To overcome this issue we decided to calculate the initial fee as a delta between fees of the two latest events, as the step value is constant for each fee increase.

Refs: #574

Deposit requires the fee to be bumped by the constant value equal the
initial redemption fee. To obtain the initial fee we looked for the very
first event, we also need the latest event. It worked fine until there
were multiple fee increases and the number of blocks to reach the first
event exceeded 10k that is a default limitation for get past events. In
such situation the first event that was returned wasn't actually the
very first event registered on chain for the deposit.
To overcome this issue we decided to calculate the initial fee as a
delta between fees of the two latest events, as the step value is constant
for each fee increase.
@nkuba nkuba requested a review from lukasz-zimnoch November 17, 2020 11:45
@pdyraga pdyraga added this to the v1.5.0 milestone Nov 17, 2020
@nkuba nkuba requested a review from pdyraga November 17, 2020 13:00
@pdyraga pdyraga merged commit 207e019 into master Nov 17, 2020
@pdyraga pdyraga deleted the fee-bump-step branch November 17, 2020 14:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants