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

fix: test-race failure #159

Merged
merged 7 commits into from
May 3, 2021
Merged

fix: test-race failure #159

merged 7 commits into from
May 3, 2021

Conversation

egonspace
Copy link

@egonspace egonspace commented Apr 30, 2021

Description

Through the test-race failure, I found that there were two concurrency-inconsistencies.

func (app *BaseApp) getContextForTx(s *state, txBytes []byte) sdk.Context {
	ctx := s.ctx.
		WithTxBytes(txBytes).
		WithVoteInfos(app.voteInfos) // app.voteInfos may be written by `BeginBlock` in concurrently

	return ctx.WithConsensusParams(app.GetConsensusParams(ctx))
}

and

// inner Query abci
ctx := sdk.NewContext(cacheMS, app.checkState.ctx.BlockHeader(), true, // checkState can be updated at `BeginRecheckTx` in concurrently
app.logger).WithMinGasPrices(app.minGasPrices)

Please review this very precisely.

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@egonspace egonspace self-assigned this Apr 30, 2021
@egonspace egonspace added this to the Initail ebony milestone Apr 30, 2021
@codecov
Copy link

codecov bot commented Apr 30, 2021

Codecov Report

Merging #159 (d9eb3b3) into v2/develop (1f739c5) will decrease coverage by 1.84%.
The diff coverage is 68.87%.

❗ Current head d9eb3b3 differs from pull request most recent head 50328be. Consider uploading reports for the commit 50328be to get more accurate results
Impacted file tree graph

@@              Coverage Diff               @@
##           v2/develop     #159      +/-   ##
==============================================
- Coverage       54.99%   53.15%   -1.85%     
==============================================
  Files             812      704     -108     
  Lines           51487    47261    -4226     
==============================================
- Hits            28317    25122    -3195     
+ Misses          20211    19579     -632     
+ Partials         2959     2560     -399     
Impacted Files Coverage Δ
client/grpc/tmservice/query.pb.gw.go 30.06% <ø> (ø)
client/keys/root.go 100.00% <ø> (ø)
client/keys/utils.go 44.11% <ø> (+5.22%) ⬆️
crypto/armor.go 85.89% <ø> (ø)
crypto/keys/ed25519/ed25519.go 67.34% <ø> (ø)
crypto/keys/multisig/codec.go 100.00% <ø> (ø)
crypto/keys/secp256k1/secp256k1.go 86.79% <ø> (ø)
simapp/test_helpers.go 8.41% <0.00%> (+7.91%) ⬆️
types/address.go 65.71% <ø> (ø)
types/config.go 84.61% <ø> (ø)
... and 84 more

baseapp/abci.go Show resolved Hide resolved
@egonspace egonspace merged commit a79c132 into v2/develop May 3, 2021
@egonspace egonspace deleted the egon/v2/fix/test_race branch May 27, 2021 04:44
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.

3 participants