Skip to content

Remove shared/utils - #1141

Closed
jshufro wants to merge 14 commits into
rocket-pool:masterfrom
jshufro:jms/nosharedutils
Closed

Remove shared/utils#1141
jshufro wants to merge 14 commits into
rocket-pool:masterfrom
jshufro:jms/nosharedutils

Conversation

@jshufro

@jshufro jshufro commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

It is no secret that I dislike "shared/utils/..."

Every time I see it, my brain thinks "shared means stuff that has no other home, and utils means stuff that has no other home" so it just seems redundant.

Beyond that, it becomes a dumping ground for situations where developers either haven't thought critically about where to put some new code, or can't resolve some import cycle.

I have removed a lot of shared/utils to directories in rocketpool/ and rocketpool-cli/, and in a few cases where it makes sense for things to be truly 'shared', i have simply moved them up a directory (eg shared/utils/hex->shared/hex).

Eventually, we should also remove shared/services and shared/types to be closer to their respective functionality in either rocketpool/ or rocketpool-cli/, and potentially rename shared to utils. At that point it'll only have a few useful math functions, colored logging, and some hex string manipulation, which are small and dumb enough to really fit the "utils" naming.

NB that there is a change to node-collector that switches from querying the bn/ec for validator/minipool balances to getting them from the NetworkState object which will need checking up on. Everything else should be more or less non-functional.

totalBeaconBalance += math.GweiToEth(validator.Balance)
}
totalDepositBalance += math.WeiToEth(minipool.NodeDepositBalance) + math.WeiToEth(minipool.UserDepositBalance)
totalNodeShare += math.WeiToEth(minipool.NodeDepositBalance)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See here for the change that needs closer inspection. Previously this queried the BN, now it gets all the data from the state.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This functionaltiy is so straightforward I was surprised it didn't already have a test.

@jshufro
jshufro marked this pull request as draft July 28, 2026 18:17
@0xfornax 0xfornax closed this Jul 28, 2026
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