Skip to content

Conversation

@walldiss
Copy link
Member

@walldiss walldiss commented Jul 6, 2024

This PR add shrex integration with shwap. Key changes:

  • Shrex uses shwap-id to request data
  • Added shwap-id verification for bot client and server
  • bumped shrex version to prevent old clients from hitting new protocol servers
  • move shrex into shwap protocols folder (closer to bitswap)
  • move shrex getter into shwap/shrex
  • update shrex getter implementation and tests

This PR is meant to be broken on lint and test CI. It will be fixed in subsequent PR, that will integrate shrex into nodebuilder.

@walldiss walldiss added kind:feat Attached to feature PRs shwap labels Jul 6, 2024
@walldiss walldiss self-assigned this Jul 6, 2024
@walldiss walldiss force-pushed the shrex-shwap branch 2 times, most recently from f266624 to e014d0a Compare July 10, 2024 08:43
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that this is an old func, but should we change to something 'safer' ? context.WithTimeout(time.Second) by example. WDYT ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it makes sense, but not in this PR. Perhaps time.Second should be passed to function in. Like

NewContextOnContextErr(ctx, newTimeout time.Time)

Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

nd review

Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

  • ctxOnError and utils moves feel competely unnecessary and could be avoided
  • general comment is to extract read(with validate)/write helpers to shwap pkg

Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

:shipit:

@walldiss walldiss merged commit c4e602a into celestiaorg:shwap Jul 30, 2024
}
srv.metrics.ObserveRequests(ctx, 1, shrex.StatusSuccess)
if err = s.Close(); err != nil {
log.Debugw("server: closing stream", "err", err)
Copy link
Member

Choose a reason for hiding this comment

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

error

return
}
if err = s.Close(); err != nil {
log.Debugw("server: closing stream", "err", err)
Copy link
Member

Choose a reason for hiding this comment

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

error

@Wondertan Wondertan deleted the shrex-shwap branch July 30, 2024 20:21
}
}

func readEds(ctx context.Context, stream network.Stream, root *share.AxisRoots) (*rsmt2d.ExtendedDataSquare, error) {
Copy link
Member

Choose a reason for hiding this comment

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

This whole helper should move to new_eds as ReadAccessor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:feat Attached to feature PRs shwap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants