File tree Expand file tree Collapse file tree 5 files changed +49
-0
lines changed
Expand file tree Collapse file tree 5 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
2222 VoteDistance ,
2323 BlockEngineUpdate ,
2424 VoteBalance ,
25+ ScheduleStrategy ,
2526} from "./types" ;
2627import { rafAtom } from "../atomUtils" ;
2728
@@ -39,6 +40,10 @@ export const startupTimeAtom = atom<
3940
4041export const tilesAtom = atom < Tile [ ] | undefined > ( undefined ) ;
4142
43+ export const scheduleStrategyAtom = atom < ScheduleStrategy | undefined > (
44+ undefined ,
45+ ) ;
46+
4247export const identityBalanceAtom = atom < IdentityBalance | undefined > ( undefined ) ;
4348
4449export const voteBalanceAtom = atom < VoteBalance | undefined > ( undefined ) ;
Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ export const identityKeySchema = z.string();
4646
4747export const startupTimeNanosSchema = z . coerce . bigint ( ) ;
4848
49+ export const scheduleStrategySchema = z . enum ( [ "perf" , "balanced" , "revenue" ] ) ;
50+ export const ScheduleStrategyEnum = scheduleStrategySchema . enum ;
51+
4952export const tileTypeSchema = z . enum ( [
5053 "sock" ,
5154 "net" ,
@@ -306,6 +309,10 @@ export const summarySchema = z.discriminatedUnion("key", [
306309 key : z . literal ( "startup_time_nanos" ) ,
307310 value : startupTimeNanosSchema ,
308311 } ) ,
312+ summaryTopicSchema . extend ( {
313+ key : z . literal ( "schedule_strategy" ) ,
314+ value : scheduleStrategySchema ,
315+ } ) ,
309316 summaryTopicSchema . extend ( {
310317 key : z . literal ( "tiles" ) ,
311318 value : tileSchema . array ( ) ,
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import {
3838 voteStateSchema ,
3939 slotTransactionsSchema ,
4040 voteBalanceSchema ,
41+ scheduleStrategySchema ,
4142} from "./entities" ;
4243
4344export type Version = z . infer < typeof versionSchema > ;
@@ -52,6 +53,8 @@ export type StartupTimeNanos = z.infer<typeof startupTimeNanosSchema>;
5253
5354export type Tile = z . infer < typeof tileSchema > ;
5455
56+ export type ScheduleStrategy = z . infer < typeof scheduleStrategySchema > ;
57+
5558export type IdentityBalance = z . infer < typeof identityBalanceSchema > ;
5659
5760export type VoteBalance = z . infer < typeof voteBalanceSchema > ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919 voteDistanceAtom ,
2020 voteStateAtom ,
2121 voteBalanceAtom ,
22+ scheduleStrategyAtom ,
2223} from "./atoms" ;
2324import {
2425 blockEngineSchema ,
@@ -70,6 +71,7 @@ export function useSetAtomWsData() {
7071
7172 const setIdentityBalance = useSetAtom ( identityBalanceAtom ) ;
7273 const setVoteBalance = useSetAtom ( voteBalanceAtom ) ;
74+ const setScheduleStrategy = useSetAtom ( scheduleStrategyAtom ) ;
7375
7476 const [ startupTime , setStartupTime ] = useAtom ( startupTimeAtom ) ;
7577
@@ -196,6 +198,10 @@ export function useSetAtomWsData() {
196198 setTiles ( value ) ;
197199 break ;
198200 }
201+ case "schedule_strategy" : {
202+ setScheduleStrategy ( value ) ;
203+ break ;
204+ }
199205 case "identity_balance" : {
200206 setIdentityBalance ( value ) ;
201207 break ;
Original file line number Diff line number Diff line change 44 clusterAtom ,
55 versionAtom ,
66 commitHashAtom ,
7+ scheduleStrategyAtom ,
78} from "../../api/atoms" ;
89import { Text , Tooltip } from "@radix-ui/themes" ;
910import styles from "./cluster.module.css" ;
@@ -16,6 +17,7 @@ import { getClusterColor } from "./util";
1617import { useMedia } from "react-use" ;
1718import { BlockEngineUpdate } from "../../api/types" ;
1819import { connectedColor , connectingColor , failureColor } from "../../colors" ;
20+ import { ScheduleStrategyEnum } from "../../api/entities" ;
1921
2022export default function Cluster ( ) {
2123 const cluster = useAtomValue ( clusterAtom ) ;
@@ -62,6 +64,8 @@ export default function Cluster() {
6264 </ Tooltip >
6365
6466 < JitoIcon />
67+
68+ < StrategyIcon />
6569 </ div >
6670 ) ;
6771}
@@ -128,3 +132,27 @@ function JitoIcon() {
128132 </ Tooltip >
129133 ) ;
130134}
135+
136+ function StrategyIcon ( ) {
137+ const scheduleStrategy = useAtomValue ( scheduleStrategyAtom ) ;
138+
139+ if ( scheduleStrategy === ScheduleStrategyEnum . balanced ) {
140+ return (
141+ < Tooltip content = "Transaction scheduler strategy: balanced" >
142+ < div > ⚖️</ div >
143+ </ Tooltip >
144+ ) ;
145+ } else if ( scheduleStrategy === ScheduleStrategyEnum . perf ) {
146+ return (
147+ < Tooltip content = "Transaction scheduler strategy: performance" >
148+ < div style = { { margin : "0 -2px" } } > ⚡</ div >
149+ </ Tooltip >
150+ ) ;
151+ } else if ( scheduleStrategy === ScheduleStrategyEnum . revenue ) {
152+ return (
153+ < Tooltip content = "Transaction scheduler strategy: revenue" >
154+ < div > 📊</ div >
155+ </ Tooltip >
156+ ) ;
157+ }
158+ }
You can’t perform that action at this time.
0 commit comments