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

limits and tiered confirmations in ChainPolicy #10812

Closed
0xpatrickdev opened this issue Jan 7, 2025 · 1 comment · Fixed by #10814
Closed

limits and tiered confirmations in ChainPolicy #10812

0xpatrickdev opened this issue Jan 7, 2025 · 1 comment · Fixed by #10814
Assignees
Labels
enhancement New feature or request

Comments

@0xpatrickdev
Copy link
Member

0xpatrickdev commented Jan 7, 2025

What is the Problem Being Solved?

As an additional layer of security, the protocol should:

  • limit advance requests for a single tx over a configurable amount
  • limit advance requests for txs in a configurable range of blocks over a configurable amount

Additionally:

  • tier number of confirmations based on tx amount
  • tier number of confirmation based on cumulative amount in block range

These values will be specified in the ChainPolicy and the logic will be implemented by oracle operator software.

Description of the Design

For MVP:

  • limit advance requests for a single tx over a configurable amount
    • add maxAmountPerTx: bigint to ChainPolicy
  • limit advance requests for txs in a configurable range of blocks over a configurable amount
    • add maxAmountPerBlockWindow: bigint and blockWindowSize: number to ChainPolicy

Stretch Goal for MVP:

  • tier number of confirmations based on tx amount
    • add txThresholds: {maxAmount: bigint; confirmations: number;}[] to ChainPolicy
  • tier number of confirmation based on cumulative amount in block range
    • add blockThresholds: {maxAmount: bigint; confirmations: number;}[] to ChainPolicy

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

@0xpatrickdev
Copy link
Member Author

0xpatrickdev commented Jan 10, 2025

We are holding off on tiered confirmations for now, but have added the following:

type ChainPolicy = {
  ...
  rateLimits: {
    /** do not advance more than this amount for an individual transaction */
    tx: bigint;
    /** do not advance more than this amount per block window */
    blockWindow: bigint;
    /** the number of blocks to consider for `blockWindow` */
    blockWindowSize: number;
  }
};

#10814 is in the merge queue and will close this ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant