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

go/runtime/client: add SubmitTxNoWait method #3746

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

ptrus
Copy link
Member

@ptrus ptrus commented Mar 2, 2021

Fixes: #3444

TODO:

  • do some more updates in client/watcher.go (now client/submitter.go) it is not just a watcher anymore but also submits transactions. Also removed the implementation of BackgroundService trait in the submitter for some minor simplifications - since this is a runtime/client package private struct only used by the client (which remains a BackgroundService) i think that's fine.

@ptrus ptrus force-pushed the ptrus/feature/runtime-submit-nowait branch from f8bc276 to 4ac0542 Compare March 2, 2021 16:47
@codecov
Copy link

codecov bot commented Mar 2, 2021

Codecov Report

Merging #3746 (37ca8ef) into master (dde272f) will increase coverage by 0.02%.
The diff coverage is 87.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3746      +/-   ##
==========================================
+ Coverage   66.86%   66.88%   +0.02%     
==========================================
  Files         401      401              
  Lines       39855    39881      +26     
==========================================
+ Hits        26648    26675      +27     
+ Misses       9415     9408       -7     
- Partials     3792     3798       +6     
Impacted Files Coverage Δ
go/runtime/client/api/grpc.go 62.04% <69.23%> (+0.35%) ⬆️
go/runtime/client/submitter.go 67.16% <80.43%> (ø)
go/runtime/client/client.go 65.76% <100.00%> (+1.54%) ⬆️
go/runtime/client/tests/tester.go 100.00% <100.00%> (ø)
go/consensus/tendermint/abci/state/state.go 54.54% <0.00%> (-9.10%) ⬇️
go/consensus/tendermint/abci/state.go 70.93% <0.00%> (-4.85%) ⬇️
...n/crypto/signature/signers/memory/memory_signer.go 72.41% <0.00%> (-3.45%) ⬇️
go/runtime/tagindexer/tagindexer.go 66.66% <0.00%> (-2.30%) ⬇️
go/storage/mkvs/cache.go 83.91% <0.00%> (-2.02%) ⬇️
go/storage/mkvs/iterator.go 80.29% <0.00%> (-1.46%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dde272f...37ca8ef. Read the comment docs.

Copy link
Member

@kostko kostko left a comment

Choose a reason for hiding this comment

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

Cool, also moves the retry/submission logic into the "watcher".

go/runtime/client/client.go Outdated Show resolved Hide resolved
@ptrus ptrus force-pushed the ptrus/feature/runtime-submit-nowait branch 5 times, most recently from 81f89f9 to f0a43bf Compare March 3, 2021 14:47
@ptrus ptrus marked this pull request as ready for review March 3, 2021 14:50
@kostko kostko requested a review from jberci March 3, 2021 17:29
Copy link
Member

@kostko kostko left a comment

Choose a reason for hiding this comment

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

Looks good to me, maybe @jberci can you take a quick look as well.

@@ -561,8 +550,8 @@ func (c *runtimeClient) Start() error {
// Implements service.BackgroundService.
func (c *runtimeClient) Stop() {
// Watchers.
for _, watcher := range c.watchers {
watcher.Stop()
for _, submitter := range c.txSubmitters {
Copy link
Member

Choose a reason for hiding this comment

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

Just noticed that this loop (and below) should probably be under a c.Lock() guard as in theory a request could come in right when this is shutting down?

Copy link
Member Author

Choose a reason for hiding this comment

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

nice find! yeah indeed should be, will update.

@ptrus ptrus force-pushed the ptrus/feature/runtime-submit-nowait branch from f0a43bf to c8b2cfd Compare March 3, 2021 18:11
@ptrus ptrus force-pushed the ptrus/feature/runtime-submit-nowait branch from c8b2cfd to 37ca8ef Compare March 4, 2021 09:12
@ptrus ptrus merged commit 3c302bd into master Mar 4, 2021
@ptrus ptrus deleted the ptrus/feature/runtime-submit-nowait branch March 4, 2021 10:42
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.

Add non-blocking runtime SubmitTx variant
3 participants