-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(staking miner): query latest state when comparing to already submitted solutions #5744
fix(staking miner): query latest state when comparing to already submitted solutions #5744
Conversation
if mode == "head" { | ||
match rpc.block_hash(None).await { | ||
Ok(Some(hash)) => Ok(hash), | ||
Ok(None) => Err(Error::Other("Best head not found".into())), |
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.
this is silly, should be very very unlikely not to get the best block hash ^^
@@ -138,6 +138,21 @@ async fn ensure_no_better_solution<T: EPM::Config, B: BlockT>( | |||
} | |||
} | |||
|
|||
async fn get_latest_head<T: EPM::Config>( | |||
rpc: &SharedRpcClient, | |||
mode: &str, |
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.
Should be enum? we can probably reuse the same enum in the CLI flags as well.
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.
haha, funny thing I just did that in the other miner repo :P
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.
LGTM!
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.
LGTM; I agree w.r.t using an enum instead of "head"
bot merge |
* master: Fix regexp to find the repo name (#5751) Limit stagnant checks to a certain amount of entries (#5742) fix(staking miner): check latest state in solution (#5744) staking-miner: CLI flag delay solution x secs (#5734) backport minimum weight to fee to master (#5739) Bump quote from 1.0.19 to 1.0.20 (#5736)
* Update metric name and doc Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> * add test and rename metric to use * change within time for test * Update .gitlab-ci.yml Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> * Update .gitlab-ci.yml Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> * Properly format the stash account Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> * Update test Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> * change metric name * Bump quote from 1.0.19 to 1.0.20 (#5736) Bumps [quote](https://github.com/dtolnay/quote) from 1.0.19 to 1.0.20. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](dtolnay/quote@1.0.19...1.0.20) --- updated-dependencies: - dependency-name: quote dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * backport minimum weight to fee to master (#5739) * propose fix fees * add tests to kusama runtime as well * better tests * last change * last update * Fix test * ignore tests again * staking-miner: CLI flag delay solution x secs (#5734) * staking-miner: CLI flag delay solution x secs * Update utils/staking-miner/src/monitor.rs * Update utils/staking-miner/src/opts.rs * more logging * add more verbose logging * Update utils/staking-miner/src/opts.rs Co-authored-by: David <dvdplm@gmail.com> * Update utils/staking-miner/src/opts.rs Co-authored-by: David <dvdplm@gmail.com> * remove redundant check Co-authored-by: David <dvdplm@gmail.com> * fix(staking miner): check latest state in solution (#5744) * bump zombienet version and fix test * Update zombienet_tests/smoke/0003-deregister-register-validator-smoke.toml Co-authored-by: Chevdor <chevdor@users.noreply.github.com> * Update zombienet_tests/smoke/0003-deregister-register-validator.js Co-authored-by: Chevdor <chevdor@users.noreply.github.com> Co-authored-by: Andrei Sandu <andrei-mihail@parity.io> Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by: David <dvdplm@gmail.com> Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com> Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
…systems * master: (39 commits) Implement prune only stagnant check mode (#5761) Bump chevdor/srtool-actions from 0.4.0 to 0.5.0 (#5769) Update release-99_bot.yml (#5764) Version bump to v0.9.26/9260 (#5755) Rename `extra_constant` (#5749) Bump wasmtime from 0.38.0 to 0.38.1 (#5741) Several small fixes to the templates of the release notes (#5756) Backports from 0.9.25 (#5754) Remove bridges subtree (#5752) [Zombienet] test deregister validator (#5718) Fix regexp to find the repo name (#5751) Limit stagnant checks to a certain amount of entries (#5742) fix(staking miner): check latest state in solution (#5744) staking-miner: CLI flag delay solution x secs (#5734) backport minimum weight to fee to master (#5739) Bump quote from 1.0.19 to 1.0.20 (#5736) zombienet: try to fix parachains upgrade test (#5724) Update dependencies (companion for substrate#11722) (#5731) Update metric name and doc (#5716) Bump reqwest from 0.11.10 to 0.11.11 (#5732) ...
* Update metric name and doc Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> * add test and rename metric to use * change within time for test * Update .gitlab-ci.yml Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> * Update .gitlab-ci.yml Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> * Properly format the stash account Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> * Update test Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> * change metric name * Bump quote from 1.0.19 to 1.0.20 (#5736) Bumps [quote](https://github.com/dtolnay/quote) from 1.0.19 to 1.0.20. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](dtolnay/quote@1.0.19...1.0.20) --- updated-dependencies: - dependency-name: quote dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * backport minimum weight to fee to master (#5739) * propose fix fees * add tests to kusama runtime as well * better tests * last change * last update * Fix test * ignore tests again * staking-miner: CLI flag delay solution x secs (#5734) * staking-miner: CLI flag delay solution x secs * Update utils/staking-miner/src/monitor.rs * Update utils/staking-miner/src/opts.rs * more logging * add more verbose logging * Update utils/staking-miner/src/opts.rs Co-authored-by: David <dvdplm@gmail.com> * Update utils/staking-miner/src/opts.rs Co-authored-by: David <dvdplm@gmail.com> * remove redundant check Co-authored-by: David <dvdplm@gmail.com> * fix(staking miner): check latest state in solution (#5744) * bump zombienet version and fix test * Update zombienet_tests/smoke/0003-deregister-register-validator-smoke.toml Co-authored-by: Chevdor <chevdor@users.noreply.github.com> * Update zombienet_tests/smoke/0003-deregister-register-validator.js Co-authored-by: Chevdor <chevdor@users.noreply.github.com> Co-authored-by: Andrei Sandu <andrei-mihail@parity.io> Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by: David <dvdplm@gmail.com> Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com> Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
No description provided.