Skip to content

Fixed issuer offset edge case#121

Merged
aalavandhan merged 4 commits intomainfrom
issuer-fix
Dec 8, 2022
Merged

Fixed issuer offset edge case#121
aalavandhan merged 4 commits intomainfrom
issuer-fix

Conversation

@aalavandhan
Copy link
Copy Markdown
Member

Based on the current implementation, there's a bug which results in a lastIssueWindowTimestamp ahead of the block.timestamp resulting in bonds > maxDuration being created. However the bond length is bounded, by maxDuration+minIssueTimeIntervalSec. (In our config in certain cases, up to a 35 day bond could be issued not strictly under 28)

Consider the following example with minIssueTimeIntervalSec=3600, issueWindowOffsetSec=900

time (HH:MM) expected lastIssueWindowTimestamp actual lastIssueWindowTimestamp
00:55 00:15 00:15
01:05 00:15 01:15
01:14 00:15 01:15
01:20 01:15 01:15
01:55 01:15 01:15
02:05 01:15 02:15

When the timestamp is between the window start and the offset (in this case X:00, X:15), it should snap to the previous hour ie (X-1:15) and NOT (X:15)

@aalavandhan aalavandhan merged commit e877da5 into main Dec 8, 2022
@aalavandhan aalavandhan deleted the issuer-fix branch December 8, 2022 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants