Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
c483301
Initial ssz spec
jshufro Apr 12, 2024
f3ac3a7
Add SSZ and JSON interop
jshufro Apr 14, 2024
573d1e0
Add tests for rewards ssz
jshufro Apr 19, 2024
012023b
Add v9 as a copy of v8 with renames
jshufro May 5, 2024
36aecfb
Bump non-struct-8s
jshufro May 5, 2024
33263bb
Return serialized json after writing rewards files to disk
jshufro May 5, 2024
08e4a69
Parameterize rewards file extension
jshufro May 5, 2024
57e73e6
Rename paths to specify format
jshufro May 6, 2024
c0c23fc
treegen implementations save rewards files
jshufro May 19, 2024
ba4d7e4
Schedule v9 for holesky and mainnet
jshufro May 19, 2024
ab9d920
Implement stateless v9
jshufro May 20, 2024
9f4c292
Deduplicate some rewards tree structures
jshufro May 21, 2024
c4f985d
Fix some small bugs
jshufro May 21, 2024
fc0f79e
Move invalidNetworkRewards out of rewards file
jshufro May 21, 2024
1145d52
Remove InvalidNetworkNodes from the tree file, return it instead
jshufro May 21, 2024
02382d0
Return MinipoolPerformanceFile in GenerateTreeResult instead of overl…
jshufro May 21, 2024
26b9d76
Delete IRewardsFile GetHeader function
jshufro May 21, 2024
71b682e
Remove INodeRewardsInfo interface
jshufro May 22, 2024
6afeb98
Delete IRewardsFile GetNetworkRewards function
jshufro May 22, 2024
bd9974e
Allow RewardsFile v3 and SSZFile v1 to be saved. Ensure SSZFile v1 co…
jshufro May 22, 2024
b7eff7b
Switch underlying ssz bigint type to math/big.Int and only convert to…
jshufro May 23, 2024
63d1490
Clarifications around the term Network in SSZFile_v1
jshufro May 23, 2024
dbe270e
Add constructors for NodeReward/NetworkReward
jshufro Jun 18, 2024
80799e0
Use SSZFile_v1 in treegen v9
jshufro May 23, 2024
2d73b45
Implement rolling v9
jshufro Jun 18, 2024
b1deefe
Use SSZFile_v1 in treegen rolling v9
jshufro Jun 18, 2024
d364450
Remove RocketPoolConfig dependency from treegen
jshufro Sep 24, 2024
be0c973
Create interface for rp rewards execution functions to support future…
jshufro Sep 25, 2024
29f5fb9
Add json decorators for NetworkState serialization
jshufro Sep 26, 2024
d943791
Simplify NetworkState and StateManager
jshufro Sep 26, 2024
a4483c7
Add cli utility for serializing NetworkState at a given slot
jshufro Sep 26, 2024
e51996d
Add beacon client interface to rewards for dependency injection
jshufro Sep 28, 2024
29be49f
Support recording critical duties slots for validators who opted in, …
jshufro Oct 7, 2024
cfb2d63
Add generator v8 mainnet unit test
jshufro Oct 7, 2024
4042c8c
Update CalculateAverageFeeAndDistributorShares to have a test-friendl…
jshufro Oct 8, 2024
ad9376e
Add mock interval tests
jshufro Oct 9, 2024
bd398dd
Rename v9 generators to include v10
jshufro Oct 20, 2024
91ffd13
Update calculations to remove rpip-30 phase-in from v9v10
jshufro Oct 20, 2024
d1a7b20
Remove hard-coding of max effective stake for rpip30 logic
jshufro Oct 20, 2024
76a105a
Add withdrawals to beacon block getter
jshufro Oct 20, 2024
3cd0c4f
Use beacon blocks instead of attestation endpoint for v9v10 performan…
jshufro Oct 20, 2024
0e35769
Add Balance queries to beacon client
jshufro Oct 28, 2024
12471d5
Use signalling instead of old system in metrics-exporter
thomaspanf Nov 4, 2024
8541edb
Deprecate SnapshotDelegation
thomaspanf Nov 4, 2024
92070b8
Implement v10 stateless
jshufro Oct 28, 2024
28dbb56
Make RewardsExecutionClient pure
jshufro Nov 1, 2024
e38215f
Implement v10 logic for rolling
jshufro Nov 3, 2024
17e8abe
Make rolling manager dependency-injection friendly
jshufro Nov 5, 2024
0511b6d
Fix some eligibility bugs
jshufro Nov 12, 2024
a0aa5a6
Fix fee calculation to account for bonus commission, update RR to be …
jshufro Nov 12, 2024
981cefb
Add backoff to validator balance queries for treegen
jshufro Nov 20, 2024
5f238b3
Make the beacon node balance queries serial, since they're so slow an…
jshufro Nov 20, 2024
35f2353
Rename getDuties to duringInterval, don't get withdrawals from blocks…
jshufro Nov 21, 2024
5bf5d7a
Fix bug where RR processed withdrawals after record end
jshufro Nov 21, 2024
98be8e1
Update snapshot-collector api calls to correctly grab voting power an…
thomaspanf Nov 22, 2024
557b870
Remove balance queries from v10, fix some bugs
jshufro Nov 22, 2024
587a590
Update v10 tests
jshufro Nov 22, 2024
cfa8704
Set v10 interval consts
jshufro Nov 22, 2024
7ee7750
Update rocketpool-go go.mod
jshufro Nov 22, 2024
9817ab5
Merge branch 'master' into jms/v10
jshufro Nov 23, 2024
437a03c
Add tests to check against full withdrawals
jshufro Nov 23, 2024
157ca6f
Only count excess balance in full withdrawals
jshufro Nov 23, 2024
7b251ff
Preallocate some beacon block vectors
jshufro Nov 24, 2024
eae26d9
Fix concurrent map access
jshufro Nov 25, 2024
b47a29b
Add nilcheck to commission scale in event of insufficient sp balance
jshufro Nov 25, 2024
6503067
Precompute EligibleBorrowedEth and cache RplStake
jshufro Nov 26, 2024
06fcc7f
Merge pull request #11 from jshufro/jms/v10-opt
jshufro Nov 26, 2024
102a83f
respect slot deadlines for attestations
jshufro Nov 26, 2024
7b2cc22
Fixed parsing method and deleted unecessary code
thomaspanf Nov 27, 2024
86a553b
Added the time.Since check to all calls within goroutine
thomaspanf Nov 27, 2024
5f017d7
Remove rolling records
jshufro Nov 29, 2024
2f9612b
nimbus-v24.11.0
0xfornax Dec 1, 2024
2e347c6
Merge pull request #709 from rocket-pool/nimbus-24.11.0
0xfornax Dec 1, 2024
d273012
lodestar-v1.23.1
0xfornax Dec 1, 2024
9f32066
Merge pull request #710 from rocket-pool/lodestar-v1.23.1
0xfornax Dec 1, 2024
baa42e3
Merge pull request #708 from rocket-pool/v1-update-metrics-exporter
0xfornax Dec 1, 2024
a550782
Edit snapshot query to exclude pre-signalling proposals
thomaspanf Dec 3, 2024
234f2a8
Check if delegate is set before grabbing voted proposals
thomaspanf Dec 4, 2024
0510f54
Add minipool details and latest delegate to node status api response
thomaspanf Dec 5, 2024
9adcac9
Merge pull request #711 from rocket-pool/v1-update-metrics-exporter
0xfornax Dec 5, 2024
215dd50
Add suggested block limit parameter
0xfornax Dec 5, 2024
186d567
Restart the VC when changing the block gas limit
0xfornax Dec 5, 2024
59f3695
Restart the VC when changing the block gas limit
0xfornax Dec 5, 2024
b3def05
Merge branch 'block-gas-limit-param' of github.com:rocket-pool/smartn…
0xfornax Dec 5, 2024
1b95bd6
Limit -> Gas limit
0xfornax Dec 5, 2024
fa1e8d3
Add committeeData.Release to reduce allocations
jshufro Dec 5, 2024
534ef12
Bump test timeout
jshufro Dec 5, 2024
03d701a
Warn users in node status about missed bonus commission
thomaspanf Dec 6, 2024
3e9c68b
Merge pull request #712 from rocket-pool/block-gas-limit-param
0xfornax Dec 6, 2024
f0db02f
chore: fix function name in comment
avoidaway Dec 9, 2024
fcf1f67
reth-v1.1.3
0xfornax Dec 10, 2024
177e30e
Merge pull request #715 from rocket-pool/reth-v1.1.3
0xfornax Dec 10, 2024
01c2201
Merge pull request #713 from rocket-pool/v1-bonus-commission-msg
0xfornax Dec 10, 2024
1333a3a
Merge pull request #698 from jshufro/jms/v10
0xfornax Dec 10, 2024
6e19a91
Merge pull request #714 from avoidaway/master
0xfornax Dec 10, 2024
3f46f22
v1.15.0
0xfornax Dec 11, 2024
45d6894
nethermind-v1.30.0
0xfornax Dec 11, 2024
397a553
lighthouse-v6.0.0
0xfornax Dec 11, 2024
e0c5783
nethermind-v1.30.1
0xfornax Dec 12, 2024
ae1a8dc
Merge pull request #716 from rocket-pool/nethermind-v1.30.0
0xfornax Dec 12, 2024
ee7ea5c
Merge pull request #717 from rocket-pool/lighthouse-v6.0.0
0xfornax Dec 12, 2024
06bd649
teku-v24.12.0
0xfornax Dec 12, 2024
81bcac9
Merge pull request #718 from rocket-pool/teku-v24.12.0
0xfornax Dec 12, 2024
2ec4577
nimbus-v24.12.0
0xfornax Dec 14, 2024
c965d63
Merge pull request #719 from rocket-pool/nimbus-v24.12.0
0xfornax Dec 15, 2024
b0f73e3
lighthouse-v6.0.1
0xfornax Dec 20, 2024
0a27d79
Update outdated PBSS message in service.go
MiConnell Dec 20, 2024
7a9c361
Merge pull request #720 from rocket-pool/lighthouse-v6.0.1
0xfornax Dec 20, 2024
0e295d2
Merge pull request #721 from MiConnell/patch-2
0xfornax Dec 20, 2024
df75ab4
Submit only if requested and print the tx
0xfornax Dec 26, 2024
9857159
Merge pull request #723 from rocket-pool/submit-param-rescue-dissolved
0xfornax Jan 6, 2025
62dcabe
Only include finalized minipools in delegate-upgrade when f flag is used
thomaspanf Jan 7, 2025
a7708ac
Merge pull request #725 from rocket-pool/v1-delegate-upgrade-flag
0xfornax Jan 8, 2025
cdafce6
lodestar-v1.24.0
0xfornax Jan 10, 2025
efe24f3
teku-v24.12.1
0xfornax Jan 10, 2025
fa44011
Merge pull request #728 from rocket-pool/teku-v24.12.1
0xfornax Jan 10, 2025
191ef9c
lodestar-v1.25.0
0xfornax Jan 20, 2025
1bf30d9
teku-v25.1.0
0xfornax Jan 22, 2025
8f606a5
Merge pull request #729 from rocket-pool/lodestar-1.25.0
0xfornax Jan 22, 2025
2de7275
Merge pull request #730 from rocket-pool/teku-v25.1.0
0xfornax Jan 23, 2025
86a86ff
Fornax's stab at state proofs
0xfornax Oct 3, 2024
a3c9f2e
go mod tidy
jshufro Jan 24, 2025
09012f3
Update fastssz
jshufro Jan 25, 2025
c52284c
Add beacon state to ssz types
jshufro Jan 26, 2025
b165f8d
go mod tidy
jshufro Jan 26, 2025
181b45b
Add EncodeToString wrapper to hexutil
jshufro Jan 26, 2025
d9722a9
Compute beacon state proofs for validators
jshufro Jan 26, 2025
b75bb5b
Fix incorrect argument count for api debug get-beacon-state
jshufro Jan 28, 2025
4d08e9f
Fix general index computation by using max validator set size instead…
jshufro Jan 28, 2025
1794e47
Sanity check that proof leaf hash matches hash root of validator
jshufro Jan 30, 2025
465b224
Compute validator proofs in relation to beacon block header, not stat…
jshufro Jan 30, 2025
22bf930
Extend the proof down to the withdrawal credentials
jshufro Jan 30, 2025
ba607d4
go mod tidy
jshufro Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: 1.21.8
- run: go test ./...
- run: go test ./... -timeout 30m
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/dustin/go-humanize v1.0.1
github.com/ethereum/go-ethereum v1.13.5
github.com/fatih/color v1.14.1
github.com/ferranbt/fastssz v0.1.3
github.com/ferranbt/fastssz v0.1.4
github.com/gdamore/tcell/v2 v2.6.0
github.com/glendc/go-external-ip v0.1.0
github.com/go-openapi/errors v0.21.0
Expand All @@ -22,6 +22,7 @@ require (
github.com/goccy/go-json v0.10.2
github.com/google/uuid v1.5.0
github.com/hashicorp/go-version v1.6.0
github.com/holiman/uint256 v1.2.4
github.com/ipfs/boxo v0.8.0
github.com/ipfs/go-cid v0.4.1
github.com/ipfs/go-datastore v0.6.0
Expand All @@ -32,7 +33,7 @@ require (
github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7
github.com/prysmaticlabs/prysm/v5 v5.0.3
github.com/rivo/tview v0.0.0-20230208211350-7dfff1ce7854
github.com/rocket-pool/rocketpool-go v1.8.4-0.20241009143357-7b6894d57365
github.com/rocket-pool/rocketpool-go v1.8.4-0.20241122223132-c5f2be18f72b
github.com/sethvargo/go-password v0.2.0
github.com/shirou/gopsutil/v3 v3.23.1
github.com/tyler-smith/go-bip39 v1.1.0
Expand Down Expand Up @@ -69,6 +70,7 @@ require (
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emicklei/dot v1.6.2 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gdamore/encoding v1.0.0 // indirect
Expand All @@ -87,7 +89,6 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.1 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/herumi/bls-eth-go-binary v1.28.1 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/ipfs/bbloom v0.0.4 // indirect
github.com/ipfs/go-bitfield v1.1.0 // indirect
github.com/ipfs/go-block-format v0.1.2 // indirect
Expand Down
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A=
github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
Expand All @@ -172,8 +174,8 @@ github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84a
github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
github.com/ferranbt/fastssz v0.0.0-20210905181407-59cf6761a7d5/go.mod h1:S8yiDeAXy8f88W4Ul+0dBMPx49S05byYbmZD6Uv94K4=
github.com/ferranbt/fastssz v0.1.3 h1:ZI+z3JH05h4kgmFXdHuR1aWYsgrg7o+Fw7/NCzM16Mo=
github.com/ferranbt/fastssz v0.1.3/go.mod h1:0Y9TEd/9XuFlh7mskMPfXiI2Dkw4Ddg9EyXt1W7MRvE=
github.com/ferranbt/fastssz v0.1.4 h1:OCDB+dYDEQDvAgtAGnTSidK1Pe2tW3nFV40XyMkTeDY=
github.com/ferranbt/fastssz v0.1.4/go.mod h1:Ea3+oeoRGGLGm5shYAeDgu6PGUlcvQhE2fILyD9+tGg=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg=
Expand Down Expand Up @@ -633,10 +635,8 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rocket-pool/go-merkletree v1.0.1-0.20220406020931-c262d9b976dd h1:p9KuetSKB9nte9I/MkkiM3pwKFVQgqxxPTQ0y56Ff6s=
github.com/rocket-pool/go-merkletree v1.0.1-0.20220406020931-c262d9b976dd/go.mod h1:UE9fof8P7iESVtLn1K9CTSkNRYVFHZHlf96RKbU33kA=
github.com/rocket-pool/rocketpool-go v1.8.4-0.20240903025128-025f78ebda85 h1:sCeOQE95E9KATbaz9rnHezLvZnJa0FdNp+kE7cwogSI=
github.com/rocket-pool/rocketpool-go v1.8.4-0.20240903025128-025f78ebda85/go.mod h1:f2TVsMOYmCwaJOhshG2zRoX89PZmvCkCD7UYJ9waRkI=
github.com/rocket-pool/rocketpool-go v1.8.4-0.20241009143357-7b6894d57365 h1:e8Y0PxBCpIV0NhCM2VvuceNbGSMfLagbMhcfwBzCNNc=
github.com/rocket-pool/rocketpool-go v1.8.4-0.20241009143357-7b6894d57365/go.mod h1:f2TVsMOYmCwaJOhshG2zRoX89PZmvCkCD7UYJ9waRkI=
github.com/rocket-pool/rocketpool-go v1.8.4-0.20241122223132-c5f2be18f72b h1:PnL2c1StqHDOjyOUYn4C/tuwhLtIZ2N/3qfNYyQlVWc=
github.com/rocket-pool/rocketpool-go v1.8.4-0.20241122223132-c5f2be18f72b/go.mod h1:f2TVsMOYmCwaJOhshG2zRoX89PZmvCkCD7UYJ9waRkI=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
Expand Down Expand Up @@ -697,8 +697,6 @@ github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2n
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U=
github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/umbracle/gohashtree v0.0.2-alpha.0.20230207094856-5b775a815c10 h1:CQh33pStIp/E30b7TxDlXfM0145bn2e8boI30IxAhTg=
github.com/umbracle/gohashtree v0.0.2-alpha.0.20230207094856-5b775a815c10/go.mod h1:x/Pa0FF5Te9kdrlZKJK82YmAkvL8+f989USgz6Jiw7M=
github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.12 h1:igJgVw1JdKH+trcLWLeLwZjU9fEfPesQ+9/e4MQ44S8=
github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8=
Expand Down
8 changes: 8 additions & 0 deletions rocketpool-cli/minipool/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
Name: "minipool, m",
Usage: "The minipool/s to upgrade (address or 'all')",
},
cli.BoolFlag{
Name: "include-finalized, f",
Usage: "Include finailized minipools in the list (default is to hide them).",
},
},
Action: func(c *cli.Context) error {

Expand Down Expand Up @@ -546,6 +550,10 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
Name: "amount, a",
Usage: "The amount of ETH to deposit into the minipool",
},
cli.BoolFlag{
Name: "no-send, n",
Usage: "Don't submit the transaction",
},
},
Action: func(c *cli.Context) error {

Expand Down
6 changes: 5 additions & 1 deletion rocketpool-cli/minipool/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ func delegateUpgradeMinipools(c *cli.Context) error {
return err
}

includeFinalized := c.Bool("include-finalized")

minipools := []api.MinipoolDetails{}
for _, mp := range status.Minipools {
if mp.Delegate != latestDelegateResponse.Address && !mp.UseLatestDelegate {
minipools = append(minipools, mp)
if includeFinalized || !mp.Finalised {
minipools = append(minipools, mp)
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion rocketpool-cli/minipool/rescue-dissolved.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ func rescueDissolved(c *cli.Context) error {
return nil
}

submit := !c.Bool("no-send")

// Refund minipool
response, err := rp.RescueDissolvedMinipool(selectedMinipool.Address, depositAmount)
response, err := rp.RescueDissolvedMinipool(selectedMinipool.Address, depositAmount, submit)
if err != nil {
return fmt.Errorf("Could not rescue minipool %s: %s.\n", selectedMinipool.Address.Hex(), err.Error())
}
Expand Down
31 changes: 24 additions & 7 deletions rocketpool-cli/node/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ func getStatus(c *cli.Context) error {

// Fee distributor details
fmt.Printf("%s=== Fee Distributor and Smoothing Pool ===%s\n", colorGreen, colorReset)
fmt.Printf("The node's fee distributor %s%s%s has a balance of %.6f ETH.\n", colorBlue, status.FeeRecipientInfo.FeeDistributorAddress.Hex(), colorReset, math.RoundDown(eth.WeiToEth(status.FeeDistributorBalance), 6))
if cfg.IsNativeMode && !status.FeeRecipientInfo.IsInSmoothingPool && !status.FeeRecipientInfo.IsInOptOutCooldown {
fmt.Printf("%sNOTE: You are in Native Mode; you MUST ensure that your Validator Client is using this address as its fee recipient!%s\n", colorYellow, colorReset)
}
if !status.IsFeeDistributorInitialized {
fmt.Printf("\n%sThe fee distributor hasn't been initialized yet. When you are able, please initialize it with `rocketpool node initialize-fee-distributor`.%s\n", colorYellow, colorReset)
}
if status.FeeRecipientInfo.IsInSmoothingPool {
fmt.Printf(
"The node is currently opted into the Smoothing Pool (%s%s%s).\n",
Expand All @@ -279,14 +286,24 @@ func getStatus(c *cli.Context) error {
}
} else {
fmt.Printf("The node is not opted into the Smoothing Pool.\nTo learn more about the Smoothing Pool, please visit %s.\n", smoothingPoolLink)
}
// Count the number of 8 ETH, <10% commission minipools
poolsWithMissingCommission := 0
leb16wei := new(big.Int)
leb16wei.SetString("16000000000000000000", 10)
for _, minipool := range status.Minipools {
if minipool.Node.DepositBalance.Cmp(leb16wei) < 0 && minipool.Node.Fee*100 < 10 {
poolsWithMissingCommission++
}
}
if poolsWithMissingCommission == 1 {
fmt.Printf("%sYou have %d minipool that would earn extra commission if you opted into the smoothing pool!%s\n", colorYellow, poolsWithMissingCommission, colorReset)
fmt.Println("See https://rpips.rocketpool.net/RPIPs/RPIP-62 for more information about bonus commission, or run `rocketpool node join-smoothing-pool` to opt in.")
}
if poolsWithMissingCommission > 1 {
fmt.Printf("%sYou have %d minipools that would earn extra commission if you opted into the smoothing pool!%s\n", colorYellow, poolsWithMissingCommission, colorReset)
fmt.Println("See https://rpips.rocketpool.net/RPIPs/RPIP-62 for more information about bonus commission, or run `rocketpool node join-smoothing-pool` to opt in.")
}

fmt.Printf("The node's fee distributor %s%s%s has a balance of %.6f ETH.\n", colorBlue, status.FeeRecipientInfo.FeeDistributorAddress.Hex(), colorReset, math.RoundDown(eth.WeiToEth(status.FeeDistributorBalance), 6))
if cfg.IsNativeMode && !status.FeeRecipientInfo.IsInSmoothingPool && !status.FeeRecipientInfo.IsInOptOutCooldown {
fmt.Printf("%sNOTE: You are in Native Mode; you MUST ensure that your Validator Client is using this address as its fee recipient!%s\n", colorYellow, colorReset)
}
if !status.IsFeeDistributorInitialized {
fmt.Printf("\n%sThe fee distributor hasn't been initialized yet. When you are able, please initialize it with `rocketpool node initialize-fee-distributor`.%s\n", colorYellow, colorReset)
}

fmt.Println()
Expand Down
2 changes: 1 addition & 1 deletion rocketpool-cli/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ func pruneExecutionClient(c *cli.Context) error {

if selectedEc == cfgtypes.ExecutionClient_Geth || selectedEc == cfgtypes.ExecutionClient_Besu {
if selectedEc == cfgtypes.ExecutionClient_Geth {
fmt.Printf("%sGeth has a new feature that renders pruning obsolete. Consider enabling PBSS in the Execution Client settings in `rocketpool service config` and resyncing with `rocketpool service resync-eth1` instead of pruning.%s\n", colorYellow, colorReset)
fmt.Printf("%sGeth has a new feature that renders pruning obsolete. However, as this is a new feature you may have to resync with `rocketpool service resync-eth1` before this takes effect.%s\n", colorYellow, colorReset)
}
fmt.Println("This will shut down your main execution client and prune its database, freeing up disk space.")
if cfg.UseFallbackClients.Value == false {
Expand Down
52 changes: 52 additions & 0 deletions rocketpool/api/debug/beacon_state.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package debug

import (
"encoding/json"
"fmt"

"github.com/urfave/cli"

"github.com/rocket-pool/smartnode/shared/services"
"github.com/rocket-pool/smartnode/shared/types/api"
hexutil "github.com/rocket-pool/smartnode/shared/utils/hex"
)

func getBeaconStateForSlot(c *cli.Context, slot uint64, validatorIndex uint64) error {
// Create a new response
response := api.BeaconStateResponse{}

// Get services
if err := services.RequireNodeRegistered(c); err != nil {
return err
}
bc, err := services.GetBeaconClient(c)
if err != nil {
return err
}

// Get beacon state
beaconState, err := bc.GetBeaconState(slot)
if err != nil {
return err
}

proof, err := beaconState.ValidatorCredentialsProof(validatorIndex)
if err != nil {
return err
}

// Convert the proof to a list of 0x-prefixed hex strings
response.Proof = make([]string, 0, len(proof))
for _, hash := range proof {
response.Proof = append(response.Proof, hexutil.EncodeToString(hash))
}

// Render response json
json, err := json.Marshal(response)
if err != nil {
return err
}
fmt.Println(string(json))

return nil
}
29 changes: 29 additions & 0 deletions rocketpool/api/debug/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,35 @@ func RegisterSubcommands(command *cli.Command, name string, aliases []string) {

},
},
{
Name: "get-beacon-state",
Aliases: []string{"b"},
Usage: "Returns the beacon state for a given slot number",
UsageText: "rocketpool api debug get-beacon-state slot-number",
Action: func(c *cli.Context) error {

// Validate args
if err := cliutils.ValidateArgCount(c, 2); err != nil {
return err
}

slotNumber, err := cliutils.ValidatePositiveUint("slot number", c.Args().Get(0))
if err != nil {
return err
}

validatorIndex, err := cliutils.ValidatePositiveUint("validator index", c.Args().Get(1))
if err != nil {
return err
}

if err := getBeaconStateForSlot(c, slotNumber, validatorIndex); err != nil {
fmt.Printf("An error occurred: %s\n", err)
}
return nil

},
},
},
})
}
10 changes: 7 additions & 3 deletions rocketpool/api/minipool/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,11 +773,11 @@ func RegisterSubcommands(command *cli.Command, name string, aliases []string) {
{
Name: "rescue-dissolved",
Usage: "Rescue a dissolved minipool by depositing ETH for it to the Beacon deposit contract",
UsageText: "rocketpool api minipool rescue-dissolved minipool-address deposit-amount",
UsageText: "rocketpool api minipool rescue-dissolved minipool-address deposit-amount submit",
Action: func(c *cli.Context) error {

// Validate args
if err := cliutils.ValidateArgCount(c, 2); err != nil {
if err := cliutils.ValidateArgCount(c, 3); err != nil {
return err
}
minipoolAddress, err := cliutils.ValidateAddress("minipool address", c.Args().Get(0))
Expand All @@ -788,9 +788,13 @@ func RegisterSubcommands(command *cli.Command, name string, aliases []string) {
if err != nil {
return err
}
submit, err := cliutils.ValidateBool("submit", c.Args().Get(2))
if err != nil {
return err
}

// Run
api.PrintResponse(rescueDissolvedMinipool(c, minipoolAddress, depositAmount))
api.PrintResponse(rescueDissolvedMinipool(c, minipoolAddress, depositAmount, submit))
return nil

},
Expand Down
14 changes: 13 additions & 1 deletion rocketpool/api/minipool/rescue-dissolved.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func getDepositTx(rp *rocketpool.RocketPool, w *wallet.Wallet, bc beacon.Client,

}

func rescueDissolvedMinipool(c *cli.Context, minipoolAddress common.Address, amount *big.Int) (*api.RescueDissolvedMinipoolResponse, error) {
func rescueDissolvedMinipool(c *cli.Context, minipoolAddress common.Address, amount *big.Int, submit bool) (*api.RescueDissolvedMinipoolResponse, error) {

// Get services
if err := services.RequireNodeRegistered(c); err != nil {
Expand Down Expand Up @@ -316,11 +316,23 @@ func rescueDissolvedMinipool(c *cli.Context, minipoolAddress common.Address, amo
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
}

opts.NoSend = !submit

// Submit the rescue deposit
tx, err := getDepositTx(rp, w, bc, minipoolAddress, amount, opts)
if err != nil {
return nil, fmt.Errorf("error submitting rescue deposit: %w", err)
}

// Print transaction if requested
if !submit {
b, err := tx.MarshalBinary()
if err != nil {
return nil, err
}
fmt.Printf("%x\n", b)
}

response.TxHash = tx.Hash()

// Return response
Expand Down
2 changes: 1 addition & 1 deletion rocketpool/api/minipool/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func getStatus(c *cli.Context) (*api.MinipoolStatusResponse, error) {
if err != nil {
return nil, err
}
details, err := getNodeMinipoolDetails(rp, bc, nodeAccount.Address, &legacyMinipoolQueueAddress)
details, err := GetNodeMinipoolDetails(rp, bc, nodeAccount.Address, &legacyMinipoolQueueAddress)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion rocketpool/api/minipool/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func validateMinipoolOwner(mp minipool.Minipool, nodeAddress common.Address) err
}

// Get all node minipool details
func getNodeMinipoolDetails(rp *rocketpool.RocketPool, bc beacon.Client, nodeAddress common.Address, legacyMinipoolQueueAddress *common.Address) ([]api.MinipoolDetails, error) {
func GetNodeMinipoolDetails(rp *rocketpool.RocketPool, bc beacon.Client, nodeAddress common.Address, legacyMinipoolQueueAddress *common.Address) ([]api.MinipoolDetails, error) {

// Data
var wg1 errgroup.Group
Expand Down
6 changes: 3 additions & 3 deletions rocketpool/api/network/generate-tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"

"github.com/fatih/color"
"github.com/rocket-pool/rocketpool-go/rewards"
"github.com/rocket-pool/smartnode/shared/services"
"github.com/rocket-pool/smartnode/shared/services/config"
"github.com/rocket-pool/smartnode/shared/types/api"
"github.com/urfave/cli"
)
Expand All @@ -32,14 +32,14 @@ func canGenerateRewardsTree(c *cli.Context, index uint64) (*api.CanNetworkGenera
response := api.CanNetworkGenerateRewardsTreeResponse{}

// Get the current interval
currentIndexBig, err := rewards.GetRewardIndex(rp, nil)
currentIndexBig, err := rp.GetRewardIndex(nil)
if err != nil {
return nil, err
}
response.CurrentIndex = currentIndexBig.Uint64()

// Get the path of the file to save
filePath := cfg.Smartnode.GetRewardsTreePath(index, true)
filePath := cfg.Smartnode.GetRewardsTreePath(index, true, config.RewardsExtensionJSON)
_, err = os.Stat(filePath)
if os.IsNotExist(err) {
response.TreeFileExists = false
Expand Down
Loading