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

medsky radical trim of bigsky (relay) #951

Closed
wants to merge 11 commits into from

Conversation

brianolson
Copy link
Contributor

sync 1.1 induction firehose

Copy link
Collaborator

@bnewbold bnewbold left a comment

Choose a reason for hiding this comment

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

Left a bunch of comments from browsing/skimming over the code.

I should do a more focused review of just the core inductive verification stuff, and the account lifecycle stuff: the actually important bits!

Will need to add handling of the #sync message once this PR lands:
bluesky-social/atproto#3391

... which might happen later today (Friday), or might be monday.

@@ -178,6 +178,7 @@ func NewBGS(db *gorm.DB, ix *indexer.Indexer, repoman *repomgr.RepoManager, evtm
slOpts.DefaultRepoLimit = config.DefaultRepoLimit
slOpts.ConcurrencyPerPDS = config.ConcurrencyPerPDS
slOpts.MaxQueuePerPDS = config.MaxQueuePerPDS
slOpts.Logger = bgs.log
Copy link
Collaborator

Choose a reason for hiding this comment

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

just checking that these updates to the top-level bgs package (vs the "vendored" copy) are intentional. they seems small and fine

cbor "github.com/ipfs/go-ipld-cbor"
mh "github.com/multiformats/go-multihash"
)

func CborStore(bs blockstore.Blockstore) *cbor.BasicIpldStore {
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably fine, but maybe worth double-checking with why about these interface changes? if they are being done repo-wide.

IIRC there is a third option which is a copy of these interfaces into the ipfs/boxo repo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

upgrading to non-deprecated boxo is separately a good idea; but I noticed that a few places use IpldBlockstore and it's a smaller simpler interface which has all the parts we ever actually use, so propagating it seems safe.
A fourth option is to define our own Blockstore interface with the subset we care about, which matches parts of an external Blockstore interface, and maybe a util wrapper with no-op implementations if we need to pass it to an external API (which it seems we never need to do because we have brought enough CAR/MST pieces in-house).


for {

select {
case <-t.C:
if err := con.WriteControl(websocket.PingMessage, []byte{}, time.Now().Add(time.Second*10)); err != nil {
log.Warn("failed to ping", "err", err)
failcount++
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this get cleared to 0 if the ping is successful?

// cachedidr = plc.NewCachingDidResolver(prevResolver, time.Hour*24, cctx.Int("did-cache-size"))
//}

// TODO: add memcached layer for shared external cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

the cache we have currently is redis (redisdir). I'll also working on a client for the identity directory service which will implement the identity.Directory / identity.Resolver interfaces and can be configured to plop in here.


var ErrNewRevBeforePrevRev = errors.New("new rev is before previous rev")

func (rm *RepoManager) VerifyCommitMessage(ctx context.Context, host *models.PDS, msg *atproto.SyncSubscribeRepos_Commit, prevRoot UserPrev) (*atrepo.Repo, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll need to do a more careful review of this at some point, but 👍 to having this all here in this codebase for this iteration, and we can refactor utility helpers over in to indigo:atproto/repo over time.

@brianolson brianolson mentioned this pull request Feb 28, 2025
@brianolson
Copy link
Contributor Author

work moved to #961

@brianolson brianolson closed this Feb 28, 2025
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