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 broken CI and unit tests #1

Merged
merged 7 commits into from
Feb 2, 2023

Conversation

prettymuchbryce
Copy link

@prettymuchbryce prettymuchbryce commented Feb 2, 2023

Fixes unit and end-to-end tests broken by our Tendermint/CometBFT fork.

  • Fixes TestEndBlockValidatorUpdatesResultingInEmptySet to account for the new mempool calls added in ApplyBlock.
  • Fixes nil pointer exceptions happening in cases where cosmosTx.Body was nil.
  • Including cosmos-sdk in this repository in this commit modified a lot of dependencies due to the way that Go dependency resolution works (as Tendermint and CosmosSDK share a number of dependencies and Go uses MVS). This was breaking some end-to-end tests due to a change in tm-db from from v0.6.6 to v0.6.7. Specifically tm-db includes rocksdb as a dependency and v0.6.7 seems to change rocksdb from tecbot/gorocksdb to cosmos/gorocksdb which seems to be a breaking change, incompatible with the way rocksdb is being installed in the end-to-end tests in this repository. As a solution here I added a replacement direction to use tm-db at v0.6.6, which is the version used upstream.
  • Resets KeepInvalidTxsInCache to false in DefaultMempoolConfig, which was causing unit tests to fail. This value should was modified in this commit, but instead should be modified in the configuration, so I did that here in v4 instead.

@prettymuchbryce prettymuchbryce marked this pull request as ready for review February 2, 2023 14:27
@prettymuchbryce prettymuchbryce changed the title CI Testing Fix broken CI and unit tests Feb 2, 2023
@@ -19,7 +19,8 @@ func IsClobOrderTransaction(
return false
}

if len(cosmosTx.Body.Messages) == 1 &&
if cosmosTx.Body != nil &&
Copy link
Author

@prettymuchbryce prettymuchbryce Feb 2, 2023

Choose a reason for hiding this comment

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

This was potentially a bug that could have caused panics.

Copy link

Choose a reason for hiding this comment

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

nice catch! in what case can the body be empty? is it possible to send an empty body tx?

Copy link
Author

@prettymuchbryce prettymuchbryce Feb 2, 2023

Choose a reason for hiding this comment

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

I am not sure if it's possible in practice, but this was happening in unit tests. It seems best to be defensive here.

config/config.go Show resolved Hide resolved
mempool/v1/mempool.go Outdated Show resolved Hide resolved
@@ -582,6 +584,11 @@ func TestEndBlockValidatorUpdatesResultingInEmptySet(t *testing.T) {
{PubKey: vp, Power: 0},
}

// dYdX fork: Apply block should lock/unlock the mempool.
Copy link

Choose a reason for hiding this comment

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

for my own understanding, could you point me to where Lock/Unlock/FlushAppConn were added?

Copy link
Author

Choose a reason for hiding this comment

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

Yes it's this commit.

@@ -19,7 +19,8 @@ func IsClobOrderTransaction(
return false
}

if len(cosmosTx.Body.Messages) == 1 &&
if cosmosTx.Body != nil &&
Copy link

Choose a reason for hiding this comment

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

nice catch! in what case can the body be empty? is it possible to send an empty body tx?

replace github.com/cosmos/cosmos-sdk v0.47.0-alpha2 => github.com/dydxprotocol/cosmos-sdk v0.47.0-alpha2-dydx-fork
replace (
github.com/cosmos/cosmos-sdk v0.47.0-alpha2 => github.com/dydxprotocol/cosmos-sdk v0.47.0-alpha2-dydx-fork
github.com/tendermint/tm-db => github.com/tendermint/tm-db v0.6.6
Copy link

@ttl33 ttl33 Feb 2, 2023

Choose a reason for hiding this comment

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

Above, there's github.com/tendermint/tm-db v0.6.7 which makes me believe that CometBFT intends to use v0.6.7. However, we are overriding that to a prev version here. Why is this the case?

Copy link

Choose a reason for hiding this comment

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

This question is answered in the PR description

@prettymuchbryce prettymuchbryce merged commit 677d636 into dydx-fork-v0.37.0-rc2 Feb 2, 2023
@prettymuchbryce prettymuchbryce deleted the prettymuchbryce/enable-ci branch February 2, 2023 23:15
lcwik pushed a commit that referenced this pull request Apr 26, 2023
* Test commit

* empty commit to trigger build

* empty commit to trigger build

* Fix TestEndBlockValidatorUpdatesResultingInEmptySet

* Fix test failures

* Add replace using tm-db v0.6.6

* Remove test comment
lcwik pushed a commit that referenced this pull request Apr 27, 2023
* Test commit

* empty commit to trigger build

* empty commit to trigger build

* Fix TestEndBlockValidatorUpdatesResultingInEmptySet

* Fix test failures

* Add replace using tm-db v0.6.6

* Remove test comment
roy-dydx pushed a commit that referenced this pull request Jun 30, 2023
* Test commit

* empty commit to trigger build

* empty commit to trigger build

* Fix TestEndBlockValidatorUpdatesResultingInEmptySet

* Fix test failures

* Add replace using tm-db v0.6.6

* Remove test comment
roy-dydx pushed a commit that referenced this pull request Jul 2, 2023
* Test commit

* empty commit to trigger build

* empty commit to trigger build

* Fix TestEndBlockValidatorUpdatesResultingInEmptySet

* Fix test failures

* Add replace using tm-db v0.6.6

* Remove test comment
roy-dydx pushed a commit that referenced this pull request Jul 2, 2023
* Test commit

* empty commit to trigger build

* empty commit to trigger build

* Fix TestEndBlockValidatorUpdatesResultingInEmptySet

* Fix test failures

* Add replace using tm-db v0.6.6

* Remove test comment
roy-dydx pushed a commit that referenced this pull request Jul 2, 2023
* Test commit

* empty commit to trigger build

* empty commit to trigger build

* Fix TestEndBlockValidatorUpdatesResultingInEmptySet

* Fix test failures

* Add replace using tm-db v0.6.6

* Remove test comment
roy-dydx pushed a commit that referenced this pull request Jul 3, 2023
* Test commit

* empty commit to trigger build

* empty commit to trigger build

* Fix TestEndBlockValidatorUpdatesResultingInEmptySet

* Fix test failures

* Add replace using tm-db v0.6.6

* Remove test comment
roy-dydx pushed a commit that referenced this pull request Jul 11, 2023
* Test commit

* empty commit to trigger build

* empty commit to trigger build

* Fix TestEndBlockValidatorUpdatesResultingInEmptySet

* Fix test failures

* Add replace using tm-db v0.6.6

* Remove test comment
lcwik added a commit that referenced this pull request Aug 30, 2023
lcwik added a commit that referenced this pull request Aug 30, 2023
lcwik added a commit that referenced this pull request Aug 30, 2023
matthewdowney pushed a commit to matthewdowney/cometbft that referenced this pull request Aug 31, 2023
* Test commit

* empty commit to trigger build

* empty commit to trigger build

* Fix TestEndBlockValidatorUpdatesResultingInEmptySet

* Fix test failures

* Add replace using tm-db v0.6.6

* Remove test comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants