-
Notifications
You must be signed in to change notification settings - Fork 161
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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++ |
There was a problem hiding this comment.
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?
cmd/medsky/main.go
Outdated
// cachedidr = plc.NewCachingDidResolver(prevResolver, time.Hour*24, cctx.Int("did-cache-size")) | ||
//} | ||
|
||
// TODO: add memcached layer for shared external cache |
There was a problem hiding this comment.
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.
cmd/medsky/repomgr/repomgr.go
Outdated
|
||
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) { |
There was a problem hiding this comment.
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.
a522a50
to
664eccf
Compare
work moved to #961 |
sync 1.1 induction firehose