Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useRollupData } from "@/hooks/rollup/useRollupData";
import { useStakerBalance } from "@/hooks/staker/useStakerBalance";
import { useNCStakerStatus } from "@/hooks/staker/useNCStakerStatus";
import { useBlockTimestamp } from "@/hooks/useBlockTimestamp";
import { usePendingWithdrawals } from "@/hooks/governance";
import { usePendingWithdrawals, useUserGovernancePower } from "@/hooks/governance";
import { ExternalGovernanceModal } from "@/components/ExternalGovernanceModal";
import { useTransactionCart } from "@/contexts/TransactionCartContext";
import {
Expand Down Expand Up @@ -201,6 +201,22 @@ export const ATPStakingCard = ({
(sum, w) => sum + w.amount,
0n
);
// Active governance voting power held by this vault's staker — tokens
// the operator (or beneficiary) explicitly deposited into the Governance
// contract, separate from any sequencer-stake delegation. This dashboard
// doesn't offer governance actions (vote, deposit, withdraw-from-gov);
// users must use the Aztec governance dashboard for those, so we surface
// a banner whenever this is non-zero so operators know to look there.
const { votingPower: stakerGovernancePower } = useUserGovernancePower({
stakerAddress: data.staker as Address | undefined,
});
const activeGovernanceAmount =
stakerGovernancePower.stakerPowers[0]?.power ?? 0n;
// Combined "tokens currently in governance" for this vault. Both active
// voting power and in-flight withdrawals from governance are tokens
// outside the sequencer-stake path that this dashboard can't act on.
const governanceTotalAmount = activeGovernanceAmount + pendingGovernanceAmount;
const hasGovernanceAllocation = governanceTotalAmount > 0n;
const [isGovernanceModalOpen, setIsGovernanceModalOpen] = useState(false);

const globalLockTimeDisplay = getTimeToClaimForATP(data, blockTimestamp);
Expand Down Expand Up @@ -555,6 +571,51 @@ export const ATPStakingCard = ({
</button>
</div>

{/* Governance allocation warning. Surfaces both active voting
power and pending governance withdrawals — neither path is
actionable from this dashboard. The button opens the same
external-frontends modal the Navbar's Governance button does. */}
{hasGovernanceAllocation && (
<div className="mb-6 p-3 border border-amber-400/40 bg-amber-400/10 flex items-start gap-3">
<Icon
name="info"
size="md"
className="text-amber-400 flex-shrink-0 mt-0.5"
/>
<div className="flex-1 min-w-0">
<div className="text-sm font-oracle-standard font-bold text-amber-400 uppercase tracking-wide mb-1">
Tokens in Governance
</div>
<div className="text-xs text-parchment/80 mb-2">
This Token Vault has{" "}
<span className="font-mono font-bold text-parchment">
{formatTokenAmount(governanceTotalAmount, decimals, symbol)}
</span>{" "}
allocated to the Governance contract
{pendingGovernanceAmount > 0n && activeGovernanceAmount > 0n && (
<>
{" "}
({formatTokenAmount(activeGovernanceAmount, decimals, symbol)}{" "}
active voting power,{" "}
{formatTokenAmount(pendingGovernanceAmount, decimals, symbol)}{" "}
pending withdrawal)
</>
)}
. These tokens are separate from sequencer stake and can't be
voted, withdrawn, or finalized from this dashboard — use the
Aztec governance dashboard to manage them.
</div>
<button
type="button"
onClick={() => setIsGovernanceModalOpen(true)}
className="text-xs font-oracle-standard font-bold uppercase tracking-wider text-amber-400 underline hover:text-amber-300"
>
Open Governance Dashboard →
</button>
</div>
</div>
)}

{/* Total Funds - Full Width */}
<div className="mb-6">
<div className="flex items-center justify-between mb-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const ValidatorStatsDisplay = ({
<div className="flex items-center gap-2">
<div className="w-2 h-2 bg-parchment" />
<span className="text-sm font-oracle-standard text-parchment uppercase tracking-wide">
Validator Capacity
Sequencer Capacity
</span>
</div>
{stakeableAtps.length > 1 && (
Expand All @@ -62,7 +62,7 @@ export const ValidatorStatsDisplay = ({

<div className="grid grid-cols-1 sm:grid-cols-2 gap-3 mb-2">
<div>
<div className="text-xs text-parchment/60 uppercase tracking-wide mb-1">Total Validators</div>
<div className="text-xs text-parchment/60 uppercase tracking-wide mb-1">Total Sequencers</div>
<div className="font-mono text-lg font-bold text-parchment">
{totalValidatorCount}
</div>
Expand All @@ -76,7 +76,7 @@ export const ValidatorStatsDisplay = ({
</div>

<div className="text-xs text-parchment/60 border-t border-parchment/20 pt-3">
Each validator requires {formatTokenAmount(activationThreshold, decimals, symbol)} minimum stake
Each sequencer requires {formatTokenAmount(activationThreshold, decimals, symbol)} minimum stake
</div>

{/* ATP Breakdown */}
Expand All @@ -86,7 +86,7 @@ export const ValidatorStatsDisplay = ({
By Token Vault
</div>
{sortedStakeableAtps.map((atp) => {
const atpValidators = activationThreshold && atp.stakeableAmount
const atpSequencers = activationThreshold && atp.stakeableAmount
? Number(atp.stakeableAmount / activationThreshold)
: 0
const displayNumber = atp.sequentialNumber || '?'
Expand All @@ -101,7 +101,7 @@ export const ValidatorStatsDisplay = ({
{formatTokenAmount(atp.stakeableAmount || 0n, decimals, symbol)}
</span>
<span className="text-sm font-bold text-parchment">
{atpValidators} validator{atpValidators !== 1 ? 's' : ''}
{atpSequencers} sequencer{atpSequencers !== 1 ? 's' : ''}
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const HeroSection = () => {
? "Does not include queued attesters. Includes sequencers who initiated exits but have not yet finalized."
: stat.title === "Minimum Stake Required"
? "The minimum amount of tokens required to create a single stake position"
: "Total tokens distributed as rewards to all validators."
: "Total tokens distributed as rewards to all sequencers."
}
size="md"
maxWidth="max-w-sm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
blockNumber: string
txHash: string
timestamp: string
atp: any

Check failure on line 19 in staking-dashboard/src/components/Provider/ProviderSequencerList.tsx

View workflow job for this annotation

GitHub Actions / Build staking dashboard frontend

Unexpected any. Specify a different type
}

interface ProviderSequencerListProps {
Expand Down Expand Up @@ -165,7 +165,7 @@
target="_blank"
rel="noopener noreferrer"
className="text-parchment/60 hover:text-chartreuse transition-colors flex-shrink-0"
title="View in validator dashboard"
title="View in sequencer dashboard"
>
<Icon name="externalLink" size="sm" />
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const RegistrationPreInfo = ({ onStartRegistration }: RegistrationPreInfo
<div className="w-1.5 h-1.5 bg-chartreuse mt-2 flex-shrink-0" />
<div>
<div className="text-sm text-parchment font-medium">Sequencer keystores</div>
<div className="text-xs text-parchment/60 mt-0.5">Validator key files ready to upload</div>
<div className="text-xs text-parchment/60 mt-0.5">Sequencer key files ready to upload</div>
</div>
</div>
<div className="flex items-start gap-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export const RegistrationUploadKeys = () => {
</span>
</div>
<p className="text-xs text-parchment/70 mb-3">
Generate your validator BLS keys
Generate your sequencer BLS keys
</p>
<a
href="https://docs.aztec.network/the_aztec_network/setup/sequencer_management#step-2-move-keystore-to-docker-directory"
Expand Down
2 changes: 1 addition & 1 deletion staking-dashboard/src/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function Sidebar() {
: styles.link
}
>
Register Validator
Register Sequencer
</Link>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
if (effectiveMaxCount !== formData.maxStakesCount) {
updateFormData({ maxStakesCount: effectiveMaxCount })
}
}, [maxStakesFromLargestAtp, formData.maxStakesCount])

Check warning on line 77 in staking-dashboard/src/components/Stake/StakeFlowAtpSelection.tsx

View workflow job for this annotation

GitHub Actions / Build staking dashboard frontend

React Hook useEffect has a missing dependency: 'updateFormData'. Either include it or remove the dependency array

// Get stakeCount from transaction cart based on stakeCount token approval (if there's any)
// so if the user reload the pages, and pending tx's is waiting for them, they dont have to select stake count again
Expand All @@ -101,7 +101,7 @@
updateFormData({ stakeCount: firstMatch.metadata.stakeCount })
setIsCountModalOpen(false)
}
}, [transactions, selectedAtp, updateFormData])

Check warning on line 104 in staking-dashboard/src/components/Stake/StakeFlowAtpSelection.tsx

View workflow job for this annotation

GitHub Actions / Build staking dashboard frontend

React Hook useEffect has a missing dependency: 'transactionType'. Either include it or remove the dependency array

// Sort and filter stakeable ATPs by total funds (desc) and required amount
const sortedStakeableAtps = useMemo(() => {
Expand All @@ -124,7 +124,7 @@
tx.metadata && "atpAddress" in tx.metadata &&
tx.metadata.atpAddress === atp.atpAddress
)
}, [transactions])

Check warning on line 127 in staking-dashboard/src/components/Stake/StakeFlowAtpSelection.tsx

View workflow job for this annotation

GitHub Actions / Build staking dashboard frontend

React Hook useCallback has a missing dependency: 'transactionType'. Either include it or remove the dependency array

// Check if the currently selected ATP has pending transactions
const hasPendingTransactionsForSelectedAtp = useMemo(() => {
Expand Down Expand Up @@ -174,7 +174,7 @@
setFirstNavigated(true)
}
}
}, [selectedAtp, sortedStakeableAtps, itemsPerPage])

Check warning on line 177 in staking-dashboard/src/components/Stake/StakeFlowAtpSelection.tsx

View workflow job for this annotation

GitHub Actions / Build staking dashboard frontend

React Hook useEffect has a missing dependency: 'firstNavigated'. Either include it or remove the dependency array

// Auto navigate to next page if the step valid
useEffect(() => {
Expand Down Expand Up @@ -262,7 +262,7 @@
<p className="text-xs text-parchment/50">
{isError
? "Please try again or check your connection"
: "You need to have Token Vaults to register as a validator"
: "You need to have Token Vaults to register as a sequencer"
}
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ export default function StakeMethodSelectionModal({
>
<div className={styles.optionIcon}>⚙️</div>
<div className={styles.optionContent}>
<h3>Register Your Validator</h3>
<h3>Register Your Sequencer</h3>
<p>
Register as an operator if you're already running your own
validator and want others to delegate to you.
sequencer and want others to delegate to you.
</p>
<ul>
<li>Requires running validator infrastructure</li>
<li>Requires running sequencer infrastructure</li>
<li>Higher potential rewards</li>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const StakingChoiceModal = ({ isOpen, onClose, selectedAtp }: StakingChoi
</div>
</div>

{/* Register Your Validator Option */}
{/* Register Your Sequencer Option */}
<div className="bg-parchment/5 border border-parchment/20 p-6 hover:border-chartreuse/50 hover:bg-chartreuse/5 transition-all">
<div className="flex flex-col items-center text-center h-full">
{/* Icon */}
Expand Down
2 changes: 1 addition & 1 deletion staking-dashboard/src/components/StatsGrid/StatCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const StatCard = ({ title, value, change, delay }: StatCardProps) => {
<TooltipIcon
content={
title === "Total Value Locked" ? "Total value of all AZTEC tokens currently staked in the protocol." :
title === "Current APR" ? "Average annual percentage rate for staking rewards across all validators." :
title === "Current APR" ? "Average annual percentage rate for staking rewards across all sequencers." :
title === "Total Stakes" ? "Total number of staking positions in the protocol." :
"Total AZTEC tokens distributed as staking rewards to all participants."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function StepSetValidatorAddress({
return (
<div className={styles.validatorContainer}>
<div className={styles.stepDescription}>
Want to run a validator?{" "}
Want to run a sequencer?{" "}
<a
href="https://docs.aztec.network/validators"
target="_blank"
Expand Down Expand Up @@ -63,7 +63,7 @@ export default function StepSetValidatorAddress({
onChange={(e) => onValidatorRunningChange(e.target.checked)}
disabled={!canInput}
/>
My validator is up and running
My sequencer is up and running
</label>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function StepUploadKeys({
return (
<div className={styles.keysContainer}>
<div className={styles.stepDescription}>
Upload your validator keys and provide necessary validator
Upload your sequencer keys and provide necessary sequencer
configuration.
</div>

Expand Down Expand Up @@ -250,7 +250,7 @@ export default function StepUploadKeys({
<option value="true">Yes</option>
</select>
<div className={styles.governanceNote}>
Whether validator follows network governance automatically.
Whether sequencer follows network governance automatically.
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ export default function StakingProviderDetailPage() {
<div className="space-y-6">
<PageHeader
title={applyHeroItalics("Selected Provider")}
description="Stake funds through existing validators"
description="Stake funds through existing sequencers"
backTo="/providers"
backLabel="Back to Delegate"
tooltip="Delegate your tokens to this provider. They will handle validator operations while you earn staking rewards. Review their commission rate and performance metrics before proceeding."
tooltip="Delegate your tokens to this provider. They will handle sequencer operations while you earn staking rewards. Review their commission rate and performance metrics before proceeding."
/>

<ProviderOverview provider={provider} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ export default function ValidatorRegistration() {
<div className={`page-content ${styles.registerView}`}>
<div className={`page-header ${styles.sectionHeader}`}>
<div>
<h2>Register your Validator</h2>
<h2>Register your Sequencer</h2>
<p>
Follow these steps to register and stake with your validator node
Follow these steps to register and stake with your sequencer node
</p>
</div>
</div>
Expand All @@ -350,7 +350,7 @@ export default function ValidatorRegistration() {
<RegistrationPreInfo onStartRegistration={handleStartRegistration} />
) : !isConnected ? (
<div className={styles.connectWalletPrompt}>
<p>Connect your wallet to register as a validator</p>
<p>Connect your wallet to register as a sequencer</p>
<ConnectButton />
</div>
) : (
Expand Down Expand Up @@ -499,7 +499,7 @@ export default function ValidatorRegistration() {
{registrationCompleted && (
<div className={styles.successMessageCompact}>
<span className={styles.successIcon}>✓</span>
<span>Successfully registered validator and staked</span>
<span>Successfully registered sequencer and staked</span>
</div>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions staking-dashboard/src/utils/stakingSteps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const STAKING_STEPS = {
title: "Select Token Position to stake",
},
SET_VALIDATOR_ADDRESS: {
title: "Input your Validator Address and confirm it's up and synced",
title: "Input your Sequencer Address and confirm it's up and synced",
},
SET_OPERATOR_ADDRESS: {
title: "Set Operator Address",
Expand All @@ -18,7 +18,7 @@ export const STAKING_STEPS = {
title: "Approve token spending",
},
UPLOAD_VALIDATOR_KEYS: {
title: "Upload Validator Keys",
title: "Upload Sequencer Keys",
},
STAKE: {
title: "Stake",
Expand Down
Loading