Skip to content
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

added delay #136

Merged
merged 2 commits into from
Oct 25, 2023
Merged

added delay #136

merged 2 commits into from
Oct 25, 2023

Conversation

markuspluna
Copy link
Contributor

Added a 45 day delay post emission fork until drop can be called

Resolves this issue:
#134

@markuspluna markuspluna requested a review from mootz12 October 22, 2023 19:06
@@ -57,6 +57,8 @@ impl Emitter for EmitterContract {

storage::set_backstop(&e, &backstop);
storage::set_blend_id(&e, &blnd_token_id);
storage::set_last_fork(&e, e.ledger().sequence() - 777600); // We set the block 45 days in the past to allow for an immediate initial drop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we set the last fork to 0 here? This requires the chain to be at least 45 days old, making the protocol very hard to deploy and use on anything but mainnet.

Further, I think it's much clearer that the initial deployment isn't a "fork", since it doesn't set the last fork time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Un-resolving this as I believe it was missed

Comment on lines 152 to 160
e.storage().persistent().bump(
&EmitterDataKey::DropStatus,
LEDGER_THRESHOLD_SHARED,
LEDGER_BUMP_SHARED,
);
e.storage()
.persistent()
.get(&EmitterDataKey::LastFork)
.unwrap_optimized()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably store this in the instance

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's going to basically always be expired if it's persistent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Also made drop_status an instance as it will also almost always be expired

@mootz12
Copy link
Contributor

mootz12 commented Oct 23, 2023

@mootz12 mootz12 self-requested a review October 24, 2023 13:55
@@ -57,6 +57,8 @@ impl Emitter for EmitterContract {

storage::set_backstop(&e, &backstop);
storage::set_blend_id(&e, &blnd_token_id);
storage::set_last_fork(&e, e.ledger().sequence() - 777600); // We set the block 45 days in the past to allow for an immediate initial drop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Un-resolving this as I believe it was missed

// TODO: Determine if setting the last distro time here is appropriate, since it means tokens immediately start being distributed
storage::set_last_distro_time(&e, &(e.ledger().timestamp() - 7 * 24 * 60 * 60));
storage::set_last_distro_time(&e, &0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this a mistake?

We probably do want an issue to track when we want distribution to begin, as this has been a placeholder for awhile.

Copy link
Contributor

@mootz12 mootz12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG2M

@mootz12 mootz12 merged commit aa10c8d into main Oct 25, 2023
3 checks passed
@mootz12 mootz12 deleted the issue-134-drop-delay branch October 25, 2023 19:49
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.

2 participants