Conversation
Fix some bugs
packages/stakers/src/mevBoost.ts
Outdated
| [Network.Lukso]: db.mevBoostLukso | ||
| [Network.Lukso]: db.mevBoostLukso, | ||
| [Network.StarknetMainnet]: { get: () => false, set: async () => {} }, | ||
| [Network.StarknetSepolia]: { get: () => false, set: async () => {} } |
There was a problem hiding this comment.
why define this in a different way? Can it be done like
[Network.StarknetMainnet]: db.mevBoostStarknetMainnet
[Network.StarknetSepolia]: db.mevBoostStarknetMainnet
I know it will probably be always "false", but just for the sake of maintainability
| consensusClients: [], | ||
| web3Signer: { | ||
| status: "ok", | ||
| dnpName: "starknetstaking-sepolia.dnp.dappnode.eth", | ||
| isInstalled: false, | ||
| isRunning: false, | ||
| isUpdated: false, | ||
| isSelected: false, | ||
| avatarUrl: "", | ||
| data: { | ||
| dnpName: "package", | ||
| reqVersion: "0.1.0", | ||
| semVersion: "0.1.0", | ||
| imageFile: { | ||
| hash: "QM..", | ||
| source: "ipfs", | ||
| size: 123 | ||
| }, | ||
| warnings: {}, | ||
| signedSafe: true, | ||
| manifest: { | ||
| name: "starknetstaking-sepolia.dnp.dappnode.eth", | ||
| description: "Starknet Sepolia Staking Application", | ||
| shortDescription: "Starknet Sepolia Staking", | ||
| version: "0.1.0" |
There was a problem hiding this comment.
why is starknetstaking part of web3signer object?
There was a problem hiding this comment.
As starknetstaking packages manages your validator keys I treated it as a signer
packages/types/src/globalEnvs.ts
Outdated
| STARKNET_CLIENT_MAINNET: "_DAPPNODE_GLOBAL_STARKNET_CLIENT_MAINNET", // "juno.dnp.dappnode.eth" | ||
| STARKNET_CLIENT_SEPOLIA: "_DAPPNODE_GLOBAL_STARKNET_CLIENT_SEPOLIA", // "juno-sepolia.dnp.dappnode.eth" |
There was a problem hiding this comment.
what package use these variables?
There was a problem hiding this comment.
None at the moment. Is it best to delete them?
packages/types/src/stakers.ts
Outdated
| Pathfinder = "pathfinder.dnp.dappnode.eth" | ||
| } | ||
| export enum SignerStarknetMainnet { | ||
| Web3signer = "starknetstaking.dnp.dappnode.eth" |
There was a problem hiding this comment.
do we add keys in starknetstacking dnp package? why treat it as web3signer?
There was a problem hiding this comment.
Your validator keys are in the starknetstacking package yep. I treated it as a signer for its similarity
packages/types/src/stakers.ts
Outdated
| Pathfinder = "pathfinder-sepolia.dnp.dappnode.eth" | ||
| } | ||
| export enum SignerStarknetSepolia { | ||
| Web3signer = "starknetstaking-sepolia.dnp.dappnode.eth" |
packages/stakers/src/consensus.ts
Outdated
| [Network.Lukso]: [ | ||
| { dnpName: ConsensusClientLukso.Prysm, minVersion: "0.1.0" }, | ||
| { dnpName: ConsensusClientLukso.Teku, minVersion: "0.1.0" } | ||
| ] | ||
| ], | ||
| [Network.StarknetMainnet]: [], | ||
| [Network.StarknetSepolia]: [] |
There was a problem hiding this comment.
can we have a min version of 0.1.0 like in the other networks when the first version of the package is the first one to be released?
just for maintainability
There was a problem hiding this comment.
As Starknet uses fullnodes, I included them in the execution.ts, so empty CC list
| { dnpName: ExecutionClientSepolia.Reth, minVersion: "0.1.0" } | ||
| ], | ||
| [Network.Lukso]: [{ dnpName: ExecutionClientLukso.Geth, minVersion: "0.1.0" }] | ||
| [Network.Lukso]: [{ dnpName: ExecutionClientLukso.Geth, minVersion: "0.1.0" }], | ||
| [Network.StarknetMainnet]: [ | ||
| { dnpName: StarknetClientMainnet.Juno, minVersion: "0.1.0" }, | ||
| { dnpName: StarknetClientMainnet.Pathfinder, minVersion: "0.1.0" } | ||
| ], | ||
| [Network.StarknetSepolia]: [ | ||
| { dnpName: StarknetClientSepolia.Juno, minVersion: "0.1.0" }, | ||
| { dnpName: StarknetClientSepolia.Pathfinder, minVersion: "0.1.0" } | ||
| ] |
There was a problem hiding this comment.
compatibility is well done here with 0.1.0
| @@ -162,10 +166,17 @@ function getChanges({ | |||
| }; | |||
|
|
|||
| // Not allowed if changes AND (EC or CC are deselected) AND (signer or mev boost) | |||
| if (!isExecAndConsSelected && (newStakerConfig.web3signerDnpName || newStakerConfig.mevBoostDnpName)) | |||
| // Exception: Starknet networks only need execution client | |||
| const hasRequiredClients = isStarknetNetwork | |||
| ? Boolean(newStakerConfig.executionDnpName) | |||
| : isExecAndConsSelected; | |||
|
|
|||
| if (!hasRequiredClients && (newStakerConfig.web3signerDnpName || newStakerConfig.mevBoostDnpName)) | |||
| return { | |||
| isAllowed: false, | |||
| reason: "To enable web3signer and/or MEV boost, execution and consensus clients must be selected", | |||
| reason: isStarknetNetwork | |||
| ? "To enable web3signer and/or MEV boost, execution client must be selected" | |||
| : "To enable web3signer and/or MEV boost, execution and consensus clients must be selected", | |||
There was a problem hiding this comment.
this is doable but makes code messy. What do you think @pablomendezroyo ?
| import { getInstallerPath } from "pages/installer"; | ||
| import { useNavigate } from "react-router-dom"; | ||
|
|
||
| export default function StarknetSigner({ |
| import { getInstallerPath } from "pages/installer"; | ||
| import { useNavigate } from "react-router-dom"; | ||
|
|
||
| export default function StarknetFullNode({ |
There was a problem hiding this comment.
same, why is this needed? can the fullnode of stakers be reused?
There was a problem hiding this comment.
Its the component for rendering the different starknet full nodes
|
|
||
| const netOf = (r: RouteType): Network | undefined => | ||
| isStakerRoute(r) ? (r.element as React.ReactElement).props?.network : undefined; | ||
| const isStakerRoute = (r: RouteType) => |
There was a problem hiding this comment.
why is this change needed?
There was a problem hiding this comment.
Otherwise, the STARKNET tab is not shown
| import StakerNetwork from "pages/stakers/components/StakerNetwork"; | ||
| import Starknet from "pages/rollups/components/Starknet"; | ||
|
|
||
| const isStakerRoute = (r: RouteType) => React.isValidElement(r.element) && r.element.type === StakerNetwork; |
There was a problem hiding this comment.
@copilot could you make a commit suggestion reverting the code from this file to the original one and implement the same for starknet that whats being done right now for optimism?
currentRoute?.subPath === "optimism" || currentRoute?.subPath === "starknet"will that make the tab render?
|
@pablomendezroyo I've opened a new pull request, #2331, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Apply Optimism pattern to Starknet in useFilterStakersNetworks Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> * Add support for starknet-sepolia testnet route Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com>
* starknet-ec-cc * starknet exec global envs * fix types * signer fix * staking app * staking app
* Set starknet envs from frontend * fix service name * print starknetstaking envs (#2335) * print starknetstaking envs * fill placeholder with current values * remove log that could print privkey * set fullnode to starknet --------- Co-authored-by: Pablo Mendez <pablo@dappnode.io> * fix color in dark mode * fix apply changes button enable --------- Co-authored-by: Pablo Mendez <pablo@dappnode.io> Co-authored-by: Marc Font <36164126+Marketen@users.noreply.github.com>
Context
Approach
Test instructions