Skip to content

Conversation

jgur-psyops
Copy link
Contributor

See #381 for description

Thanks for FEMI for the assist.

Changes:

  • Resolve merge conflicts, mostly with type crate
  • Can now extend a pause, during a pause, assuming we have not reached other limits

@Henry-E
Copy link
Contributor

Henry-E commented Sep 7, 2025

Closes #339


use crate::state::panic_state::PanicStateImpl;

pub fn panic_unpause(ctx: Context<PanicUnpause>) -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

why even bother having an unpause if it only pauses for 15 minutes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Up to 30 with extensions. I suppose we don't strictly need it but a 30 minute pause could be very annoying to the consumers so ideally we make it as short as possible whenever needed.

@Henry-E
Copy link
Contributor

Henry-E commented Sep 7, 2025

As mentioned before, it would be nice to see a validation system that e.g. in this case, by default disallows all instructions from interacting with a group in a paused state. Instead, being explicit about which instructions are allowed to be called when the protocol is paused.

await banksClient.processTransaction(tx);
});

// Note: This is an interesting edge case to consider. While liquidations are allowed to continue
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Henry-E @IliaZyrin Thoughts here before we merge?

Should we allow receivership liquidation to bypass the pause?

I will likely allow the receivership liquidations to bypass the check, which consequently either complicates the check in the constraint that we have here or forces it to move to the handler.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think either both liquidations should be allowed or both - disallowed. We chose the former for the "classic" liquidation, so let's just do the same for receivership.

Copy link
Contributor

Choose a reason for hiding this comment

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

To be honest I don't quite understand well enough what this pause is trying to achieve and context around it to determine which liquidations should be permitted.

Copy link
Contributor

@Henry-E Henry-E left a comment

Choose a reason for hiding this comment

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

LGTM

@jgur-psyops jgur-psyops merged commit 3303f70 into 0.1.5-main Sep 8, 2025
5 checks passed
@jgur-psyops jgur-psyops deleted the panic-button-internal branch September 8, 2025 22:32
@jgur-psyops jgur-psyops mentioned this pull request Sep 8, 2025
29 tasks

// If already paused and not expired, treats this as an "extend" operation.
if self.is_paused_flag() && !self.is_expired(current_timestamp) {
self.pause_start_timestamp = self
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this work exactly? Let's say at N+x where x<pause_duration if we shift forward the pause start timestamp from N to N+pause_duration. I'm assuming that this doesn't deactivate the pause somehow from between N+x -> N+pause_duration?

Copy link
Contributor

@Henry-E Henry-E Sep 9, 2025

Choose a reason for hiding this comment

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

nit - Perhaps this is one reason using a pause_start_timestamp is less intuitive than using an end_timestamp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the goal, and for you to validate in your review! It does have the awkward side effect of start being in the future, which is indeed somewhat less intuitive.

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.

4 participants