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/oasis-test-runner: governance workload #3603

Merged
merged 5 commits into from
Jan 11, 2021

Conversation

ptrus
Copy link
Member

@ptrus ptrus commented Jan 6, 2021

  • Adds the governance workload. Governance workload does the following:
    • continuously submits proposals (both upgrade & cancel pending upgrade)
    • votes for proposals (makes sure some proposals get rejected and some pass)
    • cancels any pending upgrades (via submitting a proposal and making sure it passes) UpgradeCancelMinEpochDiff before execution, to ensure no upgrades actually happen during the txsource test. In future we could/should probably also support this in the txsource test.
  • queries workload is updated with governance queries
  • use multiple entities for txsrouce validators

TODO:

  • add governance queries to queries workload

@ptrus ptrus force-pushed the ptrus/feature/governance-workload branch 2 times, most recently from 35f5216 to 3217fd4 Compare January 6, 2021 11:57
@codecov
Copy link

codecov bot commented Jan 6, 2021

Codecov Report

Merging #3603 (af513a7) into master (9cc68e4) will increase coverage by 0.03%.
The diff coverage is 54.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3603      +/-   ##
==========================================
+ Coverage   67.19%   67.23%   +0.03%     
==========================================
  Files         390      390              
  Lines       36507    36540      +33     
==========================================
+ Hits        24532    24566      +34     
+ Misses       8516     8512       -4     
- Partials     3459     3462       +3     
Impacted Files Coverage Δ
go/governance/api/api.go 100.00% <ø> (ø)
go/governance/api/proposal.go 88.23% <ø> (ø)
go/oasis-node/cmd/governance/governance.go 22.00% <25.00%> (+0.72%) ⬆️
go/consensus/tendermint/governance/governance.go 60.33% <50.00%> (-0.36%) ⬇️
go/governance/api/grpc.go 60.97% <62.50%> (+0.16%) ⬆️
go/consensus/tendermint/apps/governance/query.go 100.00% <100.00%> (ø)
...nsensus/tendermint/apps/governance/transactions.go 70.78% <100.00%> (ø)
go/governance/tests/tester.go 86.72% <100.00%> (+0.16%) ⬆️
go/common/sgx/aesm/aesm.go 62.61% <0.00%> (-6.55%) ⬇️
go/consensus/tendermint/roothash/roothash.go 68.73% <0.00%> (-4.05%) ⬇️
... and 17 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 9cc68e4...af513a7. Read the comment docs.

@ptrus ptrus force-pushed the ptrus/feature/governance-workload branch 3 times, most recently from a049a24 to 8aaf720 Compare January 7, 2021 14:34
@ptrus ptrus marked this pull request as ready for review January 7, 2021 14:37
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.

Just a very quick look, still need to check the actual governance workload 😁

go/oasis-node/cmd/debug/txsource/workload/workload.go Outdated Show resolved Hide resolved
@ptrus ptrus force-pushed the ptrus/feature/governance-workload branch from 8aaf720 to fd62866 Compare January 7, 2021 20:38
epochtime "github.com/oasisprotocol/oasis-core/go/epochtime/api"
governance "github.com/oasisprotocol/oasis-core/go/governance/api"
staking "github.com/oasisprotocol/oasis-core/go/staking/api"
"github.com/oasisprotocol/oasis-core/go/upgrade/api"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"github.com/oasisprotocol/oasis-core/go/upgrade/api"
upgrade "github.com/oasisprotocol/oasis-core/go/upgrade/api"

Comment on lines 239 to 241
// Load the validator entity nonce and cast vote.
// TODO: this would potentially need to be retried with new nonces if
// ever more workloads use the validator entity.
Copy link
Member

Choose a reason for hiding this comment

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

This comment can be removed as g.FundSignAndSubmitTx does exactly that.

if err != nil {
return fmt.Errorf("querying block: %w", err)
}
epoch2, err = cnsc.GetEpoch(g.ctx, block.Height+10)
Copy link
Member

Choose a reason for hiding this comment

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

This will not work with the new beacon as GetEpoch there performs a query which will fail if you give it a future height. Also with the new beacon there is no way to know for sure when the next transition will happen.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm yeah that's right. Ok i'll update the workload and turn things around a bit:

  • first a request will be made (e.g. submit proposal, vote ...)
  • after the request the workload will check if the request should have failed or succeed based on the state at that height

Copy link
Member Author

Choose a reason for hiding this comment

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

actually simplified it a bit more even. In case the unexpected result happens (e.g. a proposal is successfully submitted when it shouldn't be - or otherwise) the workload checks if the epoch transition just happened, and in case it did it doesn't fail the whole workload and just emits an error.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah that sounds like the right solution, thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Np! thanks for noticing that this wouldn't work with the new beacon 😁 forgot about it.

Comment on lines +445 to +429
// XXX: this makes sure that any pending upgrades that are about to be executed are
// canceled. When txsource suite supports handling upgrades mid-run, remove this part.
Copy link
Member

Choose a reason for hiding this comment

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

Is there an issue for tracking this?

Copy link
Member Author

Choose a reason for hiding this comment

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

will open one

Copy link
Member Author

Choose a reason for hiding this comment

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

opened #3609

@ptrus ptrus force-pushed the ptrus/feature/governance-workload branch from fd62866 to 2e9c02e Compare January 8, 2021 17:10
@@ -22,6 +22,7 @@ import (
"github.com/oasisprotocol/oasis-core/go/common/quantity"
consensus "github.com/oasisprotocol/oasis-core/go/consensus/api"
"github.com/oasisprotocol/oasis-core/go/consensus/api/transaction"
"github.com/oasisprotocol/oasis-core/go/governance/api"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"github.com/oasisprotocol/oasis-core/go/governance/api"
governance "github.com/oasisprotocol/oasis-core/go/governance/api"

@ptrus ptrus force-pushed the ptrus/feature/governance-workload branch from 2e9c02e to b813198 Compare January 11, 2021 08:39
@ptrus ptrus merged commit 2ef656e into master Jan 11, 2021
@ptrus ptrus deleted the ptrus/feature/governance-workload branch January 11, 2021 12:13
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.

None yet

2 participants