Skip to content

Politeia phase 2 & 3#3461

Merged
JoeGruffins merged 9 commits intodecred:masterfrom
ukane-philemon:politeia-phase-2
Feb 16, 2026
Merged

Politeia phase 2 & 3#3461
JoeGruffins merged 9 commits intodecred:masterfrom
ukane-philemon:politeia-phase-2

Conversation

@ukane-philemon
Copy link
Contributor

This PR closes #3398 and consists of Phase 2 & 3 of Politeia integration in BW as explained in #3428.

Phase 2 is Politeia integration at core and api level.
Phase 3 is Politeia integration in BW UI.

UI Video
PS: The Vote Btn is displayed for already approved proposal is purely for the sake of this video only.
https://drive.google.com/file/d/1uacGpxsdtjRW2CXgf_lfTttlJ2dtPfQa/view?usp=sharing

Copy link
Contributor

@JustinBeBoy JustinBeBoy left a comment

Choose a reason for hiding this comment

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

Look good. Just needs a little more improvement.
I will continue the review when I return.

@JoeGruffins
Copy link
Member

JoeGruffins commented Jan 19, 2026

There are some conflicts.

Copy link
Member

@JoeGruffins JoeGruffins 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! I see the props.

Sorry, you probably asked about this before, but I think proposals should be in a tab under dcrwallet. There won't be proposals for other wallets in the immediate future. I don't think it should be at the same level as trade and wallets.

image

I'm concerned about using "storm" db. It doesn't look actively developed, and you remember what happened with that mac dep recently. Inactive development can lead to problems for us. Can we just use lexi? That would probably be best.

Seeing a web console error when clicking on individual props, but this error disappeared after logging off and logging back in. Maybe don't worry about it if you can't reproduce...

TypeError: can't access property "insertRule", styleElement.sheet is null2 [element-collapser.js:91:9](moz-extension://f9b0040a-7688-4c6c-827d-7d9e02dd287b/lib/utils/element-collapser.js)
    applyCss moz-extension://f9b0040a-7688-4c6c-827d-7d9e02dd287b/lib/utils/element-collapser.js:91
    hideBySelector moz-extension://f9b0040a-7688-4c6c-827d-7d9e02dd287b/lib/utils/element-collapser.js:102
    hideBySelectorAndTagName moz-extension://f9b0040a-7688-4c6c-827d-7d9e02dd287b/lib/utils/element-collapser.js:118
    hideElement moz-extension://f9b0040a-7688-4c6c-827d-7d9e02dd287b/lib/utils/element-collapser.js:182
    tempHideElement moz-extension://f9b0040a-7688-4c6c-827d-7d9e02dd287b/lib/content-script/preload.js:495
    checkShouldCollapseElement moz-extension://f9b0040a-7688-4c6c-827d-7d9e02dd287b/lib/content-script/preload.js:549
    checkShouldCollapse moz-extension://f9b0040a-7688-4c6c-827d-7d9e02dd287b/lib/content-script/preload.js:442

I'm unable to tell what page number I am currently on:
image

@ukane-philemon
Copy link
Contributor Author

Regarding switching to lexi:

https://news.ycombinator.com/item?id=14338120 = aka badger vs bolt

https://github.com/boltdb/bolt#caveats--limitations

Bolt is good for read intensive workloads. Sequential write performance is also fast but random writes can be slow.
BadgerDB uses LSM (Log-Structured Merge) trees, making it significantly faster for write-heavy workloads.
BoltDB uses B+ trees, making it ideal for read-heavy workloads and offering simpler, more reliable ACID transactions.

@buck54321 @JoeGruffins @dajohi @davecgh wdyt? Since proposals are mostly read heavy do we still need to pick another tool for the job?

@JoeGruffins
Copy link
Member

I doubt it matters which db for this, its not reading or writing that much. Could just as well be a json file? Just concerned about adding another dependency, especially for something that, while important, doesnt demand much.

@ukane-philemon
Copy link
Contributor Author

Just concerned about adding another dependency, especially for something that, while important, doesnt demand much.

Ah I see, that's fine. I'll switch to lexi.

@JoeGruffins
Copy link
Member

We have a tool to inspect the lexi created dbs now too, so thats helpful.

@JoeGruffins
Copy link
Member

Also closes #3116

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
This PR refactors the previous politeia implementation and includes
code from dcrdata implementation which was improved to incldue desired
features like search, fetching proposal description during sync,
fast exit even during long sync process amongst other changes.

Method requirements for pi.VotingWallet was also reduced and refactored.

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
This commit implements the proposals list page and the single view proposal page
with light refactoring which icludes proper handling of URL quries in JS.

This commit also implements the /castvotes API endpoint that handles
casting tickets vote on a voting proposal.

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
@ukane-philemon
Copy link
Contributor Author

This push only resolves the conflicts...I'll add the commit that has the requested changes soon.

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
This commit impelements the lexi db for politeia and adds
some improvements to the existing code.

It also includes fixes for all previous review change requests.

Note: Some lexi varibles were exported in this commit.

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
@JoeGruffins JoeGruffins merged commit a793bdb into decred:master Feb 16, 2026
5 checks passed
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.

feature: Implement Decred Politeia voting integration

3 participants