-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
Codecov Report
@@ Coverage Diff @@
## main #315 +/- ##
=======================================
Coverage 43.42% 43.42%
=======================================
Files 26 26
Lines 1992 1992
=======================================
Hits 865 865
Misses 1005 1005
Partials 122 122 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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 feel like having existing relayers or orchestrators have an rpc to serve data might be something we want to pursue if this functionality is needed instead of spinning up a new in memory relayer each time we query a nonce, wdyt?
stopFuncs := make([]func() error, 0) | ||
defer func() { | ||
for _, f := range stopFuncs { | ||
err := f() | ||
if err != nil { | ||
logger.Error(err.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.
[not blocking]
ideally we just call this later and pass the slice after we have appended to it. This should work, I think its just not ideal since multiple routines could touch that slice simultaneously. also, since we're already make
ing a slice, then we might as well use the expected capacity
stopFuncs := make([]func() error, 0, 1)
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.
// creating the data store | ||
dataStore := dssync.MutexWrap(ds.NewMapDatastore()) | ||
|
||
// creating the dht | ||
dht, err := p2p.NewQgbDHT(cmd.Context(), h, dataStore, []peer.AddrInfo{}, logger) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// creating the p2p querier | ||
p2pQuerier := p2p.NewQuerier(dht, logger) | ||
|
||
nonce, err := parseNonce(ctx, appQuerier, args[0]) | ||
if err != nil { | ||
return err | ||
} | ||
if nonce == 1 { | ||
return fmt.Errorf("nonce 1 doesn't need to be signed. signatures start from nonce 2") | ||
} | ||
|
||
err = getSignaturesAndPrintThem(ctx, logger, appQuerier, tmQuerier, p2pQuerier, nonce) | ||
if err != nil { | ||
return err | ||
} |
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.
how long should this take and how heavy is this operation? should we just query an existing relayer instead of spinning up one in memory and querying the dht?
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.
It takes no time to do this. Yes, it would make sense to add an RPC endpoint to get this information. However, we don't have time right now to implement it and we need a way to know who signed or not. We can merge this and open an issue to have this as an endpoint, what do you think?
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.
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.
okie dokie that's what I thought
Overview
Closes #292
Checklist