Skip to content

Unify pool configuration flows#218

Merged
plebhash merged 6 commits into
stratum-mining:mainfrom
pavlenex:cunify-pool-configuration-flows
Jul 21, 2026
Merged

Unify pool configuration flows#218
plebhash merged 6 commits into
stratum-mining:mainfrom
pavlenex:cunify-pool-configuration-flows

Conversation

@pavlenex

@pavlenex pavlenex commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

This PR replaced the three separate custom-pool workflows from PR #217 with one shared pool configuration flow used by both Setup and Settings. Users can now add, remove, and reorder primary and fallback pools in the same interface. The primary payout address or username is entered once, while fallback pools inherit it automatically unless the user explicitly chooses to customize them.

This is better because there is now one consistent behavior to understand, test, and maintain instead of several implementations that could drift apart. It also reduces repetitive forms and excessive scrolling, preserves custom fallback identities safely, and validates pool configuration on both the client and server before saving.

I based it on #217 to preserve commit history and credit the author for the effort that inspired a more complex refactor. There's a lot here so no need to prio review, but whenever you get a chance @lucasbalieiro I'd appreciate if you have a better idea on how to architect this.

Screen.Recording.2026-07-17.at.14.55.02.mov

@pavlenex
pavlenex force-pushed the cunify-pool-configuration-flows branch from 2f0e611 to f5b4bd8 Compare July 17, 2026 10:08
@pavlenex
pavlenex requested a review from lucasbalieiro July 17, 2026 10:09
@pavlenex
pavlenex force-pushed the cunify-pool-configuration-flows branch from f5b4bd8 to 240679c Compare July 17, 2026 11:47
@Ayush4958

Copy link
Copy Markdown
Contributor

@pavlenex
I really like this new architecture which removes dropdown select and introduce direct selection and customization.

really learned from it ...

Comment thread server/src/pool-validation.ts Outdated
Comment thread src/components/pools/PoolIdentityFields.tsx Outdated

@lucasbalieiro lucasbalieiro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I first of all thank you guys. Seems like a nice and structured improvement.
I've did the fist round of reading the important code changes here. I'm gonna take a time now to do some testing locally

@pavlenex

Copy link
Copy Markdown
Contributor Author

Thank you so much @lucasbalieiro! We depend on your reviews 🫂

@lucasbalieiro

Copy link
Copy Markdown
Collaborator

If you select multiple pools, set the SRI as primary and donate 100% the UI loses the information of the payout address that it asked and make me type the address for each one again.

that is expected because the UI is cleaning the address if you give 100% to SRI pool. but seems that a UI improvement could be preserving this data and apply to the pools that does not support our user_identity features of donation.

Screen.Recording.2026-07-20.at.15.19.41.mov

@lucasbalieiro

Copy link
Copy Markdown
Collaborator

when setting the donation to 100%, I can only go back to 0% or 100%, no mid value

Screen.Recording.2026-07-20.at.15.31.09.mov

@Ayush4958

Ayush4958 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

in src/lib/miningIdentity.ts

buildSriIdentity function drops the address from the encoded string when donation is 100%, present here :-

if (donationPercent >= 100) {
  return worker ? `sri/donate/${worker}` : 'sri/donate';
  //  address gets dropped
}

So when the user enter their address and sets donation to 100, the identity becomes just "sri/donate". Their entered address is dropped. So even after user sets back the donation to any range it gets called with empty address and had to enter the address again.

The slider only fixed to 0 and 100 is the consequence of it.

we can fix it modifying this buildSriIdentity function like that :-

 export function buildSriIdentity(address: string, workerName: string, donationPercent: number): string {
   const addr = address.trim();
   const worker = workerName.trim();
   if (donationPercent >= 100) {
    if (!addr && !worker) return 'sri/donate';
    if (!addr) return `sri/donate/${worker}`;
    return worker
      ? `sri/donate/100/${addr}/${worker}`
   : `sri/donate/100/${addr}`;
   }

This is after the fix :-

Screen.Recording.2026-07-21.012737.mp4

on 100, user cannot continue , It says it should be b/w 0-99
we can change with small tweak, If we had to change it

@Ayush4958

Copy link
Copy Markdown
Contributor

Note :- This bug is not created in this PR, they were present already in the file but they were not exposed

@pavlenex
pavlenex force-pushed the cunify-pool-configuration-flows branch from 0f16db4 to b44fe34 Compare July 21, 2026 05:24
@pavlenex
pavlenex requested a review from lucasbalieiro July 21, 2026 05:25
@pavlenex

Copy link
Copy Markdown
Contributor Author

@lucasbalieiro another nice catch, fixed via

Screen.Recording.2026-07-21.at.10.29.59.mov

b44fe34

@lucasbalieiro lucasbalieiro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

tACK looks very nice.

My concerned with loop useEffect was addressed when the useRef was addded in b44fe34

confirmed that the pool priority on the config file is correctly ordered after this refactor:

Image

confirmed that after a modifying the pools list inside the dashboard settings, the changes are applied correctly after tis refactor

Image

@pavlenex
pavlenex force-pushed the cunify-pool-configuration-flows branch from b44fe34 to d84ef24 Compare July 21, 2026 15:36
@pavlenex

pavlenex commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for review @lucasbalieiro I've just resolved conflicts introduced when we merged #219. I think this one should be good to go. Needs final approval.

@lucasbalieiro lucasbalieiro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did a quick check on the main points after the rebase and LGTM

@plebhash
plebhash merged commit d82036b into stratum-mining:main Jul 21, 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.

Add ability to add a custom fallback pool from settings not just the startup

4 participants