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: state: Allow lotus-miner info to complete without admin permission #8057

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

mtelka
Copy link
Contributor

@mtelka mtelka commented Feb 10, 2022

Related Issues

lotus-miner info currently fails to complete without admin permission

Proposed Changes

Instead of return in infoCmdAct() when LogAlerts() fails, just print error and continue.

Additional Info

Without this fix lotus-miner info fails to complete without admin perms like this:

$ lotus-miner info
Enabled subsystems (from miner API): [Mining Sealing SectorStorage Markets]
Enabled subsystems (from markets API): [Mining Sealing SectorStorage Markets]
Chain: [sync ok] [basefee 100 aFIL]
ERROR: getting alerts: missing permission to invoke 'LogAlerts' (need 'admin')

$

With the fix it is far better:

$ lotus-miner info | head -n 10
Enabled subsystems (from miner API): [Mining Sealing SectorStorage Markets]
Enabled subsystems (from markets API): [Mining Sealing SectorStorage Markets]
Chain: [sync ok] [basefee 100 aFIL]
ERROR: getting alerts: %!w(*jsonrpc.respError=&{1 missing permission to invoke 'LogAlerts' (need 'admin')})
Miner: t01105 (32 GiB sectors)
Power: 1.19 Ti / 2.59 Pi (0.0448%)
        Raw: 1.188 TiB / 1.956 PiB (0.0593%)
        Committed: 1.188 TiB
        Proving: 1.188 TiB
Projected average block win rate: 45.11/week (every 3h43m28s)
$

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

@mtelka mtelka requested a review from a team as a code owner February 10, 2022 09:42
cmd/lotus-miner/info.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 10, 2022

Codecov Report

Merging #8057 (3c82ee4) into master (e7038d2) will decrease coverage by 0.12%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8057      +/-   ##
==========================================
- Coverage   39.18%   39.06%   -0.13%     
==========================================
  Files         662      662              
  Lines       72139    72139              
==========================================
- Hits        28271    28178      -93     
- Misses      38972    39040      +68     
- Partials     4896     4921      +25     
Impacted Files Coverage Δ
cmd/lotus-miner/info.go 60.11% <0.00%> (ø)
chain/events/message_cache.go 87.50% <0.00%> (-12.50%) ⬇️
chain/stmgr/call.go 67.87% <0.00%> (-7.28%) ⬇️
markets/retrievaladapter/client_blockstore.go 62.50% <0.00%> (-6.25%) ⬇️
chain/exchange/peer_tracker.go 66.66% <0.00%> (-4.31%) ⬇️
storage/wdpost_sched.go 77.45% <0.00%> (-3.93%) ⬇️
chain/vm/mkactor.go 48.48% <0.00%> (-3.04%) ⬇️
miner/miner.go 55.40% <0.00%> (-2.96%) ⬇️
chain/sync.go 65.00% <0.00%> (-2.67%) ⬇️
chain/events/events_called.go 83.90% <0.00%> (-1.96%) ⬇️
... and 16 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 e7038d2...3c82ee4. Read the comment docs.

@mtelka mtelka requested a review from magik6k February 10, 2022 12:03
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Thanks!

@magik6k magik6k merged commit a3e785c into filecoin-project:master Feb 15, 2022
@mtelka mtelka deleted the info-noadmin branch February 15, 2022 14:53
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.

2 participants