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

Enhance Democracy States; replace Cancelled with Rejeceted and SupersededBy #1687

Merged
merged 8 commits into from
Jul 2, 2024

Conversation

brenzi
Copy link
Member

@brenzi brenzi commented Jun 25, 2024

replace the ambiguous "Cancelled" proposal state with

  • "Rejected" (didn't reach approval threshold for long enough before proposal expired

  • "SupersededBy" (another proposal for same action got approved first)

  • fix strange "ongoing" timestamp: uses 24h plus 12h representation redundantly

  • (optional) display which proposal id did supersede the proposal "Superseded by 6"

tested locally with

  • Ab/democracy bots encointer-node#370
  • in order to let a proposal expire instead of being superseded. just pause the phase.py script for 20min when a proposal has been submitted but not yet voted on and then start it again

@brenzi brenzi requested a review from clangenb June 25, 2024 16:00
@brenzi
Copy link
Member Author

brenzi commented Jun 25, 2024

rejected works as expected:

image

@brenzi
Copy link
Member Author

brenzi commented Jun 26, 2024

I can't vote. it seems the extrinsic fails and the UI is stuck in the Aye/Nay dialogue

D/EGL_emulation(29376): app_time_stats: avg=2.19ms min=1.41ms max=6.43ms count=57
[log] [PRINT]  ==> : Header: {parentHash: 0x826eafd21c6fda9a44b7afe2820aacc6e4ed5ce48af57dfeaf4aad849063bcfc, number: 0x2bc, stateRoot: 0xad50f71a80068ca59eecca753280322495a16ab705effba47fd2ffdd853923b8, extrinsicsRoot: 0x8f8b67de0451d422adf3c826670e048ab22925722d07ec5c50ab37fdf46cb294, digest: {logs: [0x066175726120b3a1141100000000, 0x056175726101015c8eb0168869143b502b3649ae4c3cab79ae4511aeeba07053b5847ed49a0f7cfe4e0f438ed140046e71f47d08d36d6d0f9006f392b1a5cb2edbab55e91c3e8d]}} 
[log] [PRINT]  ==> : [subscribeNewHeads] Got header: {number: 700} 
[log] [PRINT]  ==> : [getBlockHash] params: [700] 
[log] [PRINT]  ==> : [getBlockHash] hash: 0xb14359e491165e51693463864be8b0e909fc8176f4f4e0a4e2d484fa4c7fe080 
D/EGL_emulation(29376): app_time_stats: avg=2.38ms min=1.48ms max=5.79ms count=58
[log] [DEBUG]  ==> : [TxPaymentAsset]: Enough funds in preferred cid {"principal":"2.0999952676158875","lastUpdate":648} to pay tx fee. 
[log] [DEBUG]  ==> : [webApi] Provider is connected: true 
D/EGL_emulation(29376): app_time_stats: avg=15.21ms min=1.51ms max=407.39ms count=32
[log] [ERROR]  ==> : Caught RPC error while sending extrinsics: Exception: {code: 1002, message: Verification Error: Runtime error: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:
error while executing at wasm backtrace:
    0: 0x19e13a - <unknown>!rust_begin_unwind
    1: 0x87fc - <unknown>!core::panicking::panic_fmt::hd76cc5a8b1843eaf
    2: 0x14160e - <unknown>!TaggedTransactionQueue_validate_transaction, data: RuntimeApi("Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed\nWASM backtrace:\nerror while executing at wasm backtrace:\n    0: 0x19e13a - <unknown>!rust_begin_unwind\n    1: 0x87fc - <unknown>!core::panicking::panic_fmt::hd76cc5a8b1843eaf\n    2: 0x14160e - <unknown>!TaggedTransactionQueue_validate_transaction")} 
[log] [DEBUG]  ==> : Verified Reputations for Proposal 6: {4: {"communityIdentifier":{"geohash":"0x656d667264","digest":"0xe48c8961"},"reputation":{"VerifiedLinked":5}}} 
[log] [DEBUG]  ==> : Eligible Reputations for Proposal 6: {4: {"communityIdentifier":{"geohash":"0x656d667264","digest":"0xe48c8961"},"reputation":{"VerifiedLinked":5}}} 
[log] [DEBUG]  ==> : [hasCommittedFor] keys     = (0x3ab1e52fe7e27607bc1cb70613b457e3ca407206ec1ab726b2636c4b145ac2875b457d80ce6f09b8627ae74dd49b1219656d667264e48c896104000000050000000000000006309136f291ac2007bba3edef1b55ef6df571f6147006b0fb34813ed9c78351, 0x3ab1e52fe7e27607bc1cb70613b457e3ca407206ec1ab726b2636c4b145ac2875b457d80ce6f09b8627ae74dd49b1219656d667264e48c89610400000005000000000000000cab1de764a062db344e8c14c77bb1c5d745ead7d51e5f6fbc900744cba45277, 0x3ab1e52fe7e27607bc1cb70613b457e3ca407206ec1ab726b2636c4b145ac2875b457d80ce6f09b8627ae74dd49b1219656d667264e48c89610400000005000000000000000e872c7eec12f91b6a3a47e3962db0b30f33f4cc7a7d81e531fb91c31b28975f, ..., 0x3ab1e52fe7e27607bc1cb70613b457e3ca407206ec1ab726b2636c4b145ac2875b457d80ce6f09b8627ae74dd49b1219656d667264e48c8961040000000500000000000000a66a059a31d3c07263da726592722210bf726ef0a77360d175c81c8ca71b1175, 0x3ab1e52fe7e27607bc1cb70613b457e3ca407206ec1ab726b2636c4b145ac2875b457d80ce6f09b8627ae74dd49b1219656d667264e48c8961040000000500000000000000a8f8c563b0537a659219ad490d339ee51c7ff21643d2252b36bb71e01570cc39) 
[log] [DEBUG]  ==> : [hasCommittedFor] fullKey  = 0x3ab1e52fe7e27607bc1cb70613b457e3ca407206ec1ab726b2636c4b145ac2875b457d80ce6f09b8627ae74dd49b1219656d667264e48c8961040000000500000000000000da08838c15723e50b94ac17ee630de35aa9c72451f5c63f472ee9fe197330f39 
[log] [DEBUG]  ==> : [hasCommittedFor] hasCommitted = false 
[log] [DEBUG]  ==> : Uncommitted Reputations for Proposal 6: [Instance of 'Tuple2<CommunityIdentifier, int>'] 
[log] [DEBUG]  ==> : Committed Reputations for Proposal 6: [] 
D/EGL_emulation(29376): app_time_stats: avg=5.73ms min=1.40ms max=35.01ms count=57
D/EGL_emulation(29376): app_time_stats: avg=2.03ms min=1.65ms max=2.66ms count=51
D/EGL_emulation(29376): app_time_stats: avg=2.30ms min=1.61ms max=6.15ms count=49
[log] [PRINT]  ==> : Header: {parentHash: 0xb14359e491165e51693463864be8b0e909fc8176f4f4e0a4e2d484fa4c7fe080, number: 0x2bd, stateRoot: 0xfdfa3021174cbf6c539c0e914f9e9eee98ba671891510af2fa5f0f0567f19bb0, extrinsicsRoot: 0x07cfcc97180c8c8ec19e43a12eef62ec3951110da08a5397e03751720695013e, digest: {logs: [0x066175726120b4a1141100000000, 0x056175726101011c76915416ffdf2b47a2f7a10a1b5e5423e73e556ea599b4ced5b09cdc69dc19a062614c39c63138e3839d1b0c973f4cff2bf434375aed604651ad7dd4c8a684]}} 
[log] [PRINT]  ==> : [subscribeNewHeads] Got header: {number: 701} 
[log] [PRINT]  ==> : [getBlockHash] params: [701] 
[log] [PRINT]  ==> : [getBlockHash] hash: 0x96905a47e83f78232a7439df92f04afd15751f5e566da0d22790ef0fef5e9bc2 
D/EGL_emulation(29376): app_time_stats: avg=2.38ms min=1.36ms max=8.04ms count=48
D/EGL_emulation(29376): app_time_stats: avg=2.05ms min=1.52ms max=6.22ms count=52
D/EGL_emulation(29376): app_time_stats: avg=2.57ms min=1.51ms max=6.74ms count=46
D/EGL_emulation(29376): app_time_stats: avg=2.40ms min=1.46ms max=4.64ms count=51
D/EGL_emulation(29376): app_time_stats: avg=1.97ms min=1.37ms max=3.70ms count=56
D/EGL_emulation(29376): app_time_stats: avg=2.43ms min=1.59ms max=4.91ms count=50
Application finished.

brenzi and others added 2 commits June 26, 2024 10:09
* fmt

* fix warnings and add supersededBy(id) localization
@clangenb clangenb added A0-ux PR changes the UX B0-low Does not elevate a release containing this beyond "low priority" C0-breaksnothing PR does not introduce any breaking changes labels Jun 26, 2024
Copy link
Member

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

Looks good to me! Happy to see that the CI works again.

I am just unsure about the timestamp in the proposal list, but I have made a follow up issue for that.

@clangenb clangenb changed the title Ab/democracy proposal state superseded rejected Enhance Democracy States; replace Cancelled with Rejeceted and SupersededBy Jul 2, 2024
@clangenb clangenb merged commit 543d5f7 into master Jul 2, 2024
8 of 10 checks passed
@clangenb clangenb mentioned this pull request Jul 12, 2024
@clangenb clangenb deleted the ab/democracy-proposal-state-superseded-rejected branch July 22, 2024 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-ux PR changes the UX B0-low Does not elevate a release containing this beyond "low priority" C0-breaksnothing PR does not introduce any breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants