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

feat!: throttle with retries, consumer changes #1024

Merged
merged 101 commits into from
Aug 10, 2023

Conversation

shaspitz
Copy link
Contributor

@shaspitz shaspitz commented Jun 15, 2023

Description

Implements the consumer-side changes from https://cosmos.github.io/interchain-security/adrs/adr-008-throttle-retries. See this comment for further context on how the behavior from the ADR was implemented in code.

Note the changes should be self documented, with an addition to the ADR to explain how upgrading would look like. Essentially, these changes should be merged separately and only affect consumers, with the provider throttling remaining unchanged. Then a future PR with provider changes can fully enable "throttling v2".

Note e2e tests for new throttling functionality will be added to the PR introducing provider changes.

IMPORTANT: Note diff tests are currently commented out for this PR. We'll need a decision around what to do there.

Closes #1101

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Added ! to the type prefix if API or client breaking change
  • Confirmed this PR does not introduce changes requiring state migrations, OR migration code has been added to consumer and/or provider modules
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Followed the guidelines for building SDK modules
  • Included the necessary unit and integration tests
  • Added a changelog entry to CHANGELOG.md
  • Included comments for documenting Go code
  • Updated the relevant documentation or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed this PR does not introduce changes requiring state migrations, OR confirmed migration code has been added to consumer and/or provider modules
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage

@shaspitz shaspitz changed the base branch from main to shawn/optimize-pending-packets-storage June 23, 2023 22:01
@@ -223,6 +236,40 @@ func (k Keeper) SendPackets(ctx sdk.Context) {
// in conjunction with the ibc module's execution of "acknowledgePacket",
// according to https://github.com/cosmos/ibc/tree/main/spec/core/ics-004-channel-and-packet-semantics#processing-acknowledgements
func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, ack channeltypes.Acknowledgement) error {
if res := ack.GetResult(); res != nil {
if len(res) != 1 {
return fmt.Errorf("acknowledgement result length must be 1, got %d", len(res))
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this error message logged by IBC? If not, we should log it for better debugging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shaspitz shaspitz merged commit fbbac82 into main Aug 10, 2023
12 of 13 checks passed
@shaspitz shaspitz deleted the shawn/throttle-with-retries-consumer-changes branch August 10, 2023 16:08
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.

Consumer changes for throttling v2
3 participants