@@ -188,7 +188,8 @@ function MeteringCard({ meter }: { meter: MeterBundleResponse }) {
188188 ( sum , r ) => sum + r . executionTimeUs ,
189189 0 ,
190190 ) ;
191- const totalTimeUs = executionTimeUs + meter . stateRootTimeUs ;
191+ const stateRootTimeUs = meter . stateRootTimeUs ?? 0 ;
192+ const totalTimeUs = executionTimeUs + stateRootTimeUs ;
192193
193194 return (
194195 < Card >
@@ -203,7 +204,7 @@ function MeteringCard({ meter }: { meter: MeterBundleResponse }) {
203204 < div >
204205 < div className = "text-xs text-gray-500 mb-1" > State Root</ div >
205206 < div className = "text-xl font-semibold text-gray-900" >
206- { meter . stateRootTimeUs . toLocaleString ( ) } μs
207+ { stateRootTimeUs . toLocaleString ( ) } μs
207208 </ div >
208209 </ div >
209210 < div >
@@ -213,23 +214,23 @@ function MeteringCard({ meter }: { meter: MeterBundleResponse }) {
213214 </ div >
214215 </ div >
215216 </ div >
216- { ( meter . stateRootAccountNodeCount > 0 ||
217- meter . stateRootStorageNodeCount > 0 ) && (
217+ { ( ( meter . stateRootAccountLeafCount ?? 0 ) > 0 ||
218+ ( meter . stateRootStorageLeafCount ?? 0 ) > 0 ) && (
218219 < div className = "grid grid-cols-2 gap-6 mt-4 pt-4 border-t border-gray-100" >
219220 < div >
220221 < div className = "text-xs text-gray-500 mb-1" >
221222 Account Trie Nodes
222223 </ div >
223224 < div className = "text-xl font-semibold text-gray-900" >
224- { meter . stateRootAccountNodeCount . toLocaleString ( ) }
225+ { ( ( meter . stateRootAccountLeafCount ?? 0 ) + ( meter . stateRootAccountBranchCount ?? 0 ) ) . toLocaleString ( ) }
225226 </ div >
226227 </ div >
227228 < div >
228229 < div className = "text-xs text-gray-500 mb-1" >
229230 Storage Trie Nodes
230231 </ div >
231232 < div className = "text-xl font-semibold text-gray-900" >
232- { meter . stateRootStorageNodeCount . toLocaleString ( ) }
233+ { ( ( meter . stateRootStorageLeafCount ?? 0 ) + ( meter . stateRootStorageBranchCount ?? 0 ) ) . toLocaleString ( ) }
233234 </ div >
234235 </ div >
235236 </ div >
@@ -239,7 +240,7 @@ function MeteringCard({ meter }: { meter: MeterBundleResponse }) {
239240 < div >
240241 < span className = "text-gray-500" > Total Gas</ span >
241242 < span className = "ml-2 font-medium text-gray-900" >
242- { meter . totalGasUsed . toLocaleString ( ) }
243+ { ( meter . totalGasUsed ?? 0 ) . toLocaleString ( ) }
243244 </ span >
244245 </ div >
245246 < div >
@@ -613,14 +614,16 @@ function RejectedTransactionsTab() {
613614 ) ;
614615}
615616
616- function getInitialTab ( ) : Tab {
617- if ( typeof window === "undefined" ) return "blocks" ;
618- const hash = window . location . hash . replace ( "#" , "" ) ;
619- return hash === "rejected" ? "rejected" : "blocks" ;
620- }
621-
622617export default function Home ( ) {
623- const [ activeTab , setActiveTab ] = useState < Tab > ( getInitialTab ) ;
618+ const [ activeTab , setActiveTab ] = useState < Tab > ( "blocks" ) ;
619+
620+ // Read hash on client only after hydration
621+ useEffect ( ( ) => {
622+ const hash = window . location . hash . replace ( "#" , "" ) ;
623+ if ( hash === "rejected" ) {
624+ setActiveTab ( "rejected" ) ;
625+ }
626+ } , [ ] ) ;
624627 const [ error , setError ] = useState < string | null > ( null ) ;
625628 const [ blocks , setBlocks ] = useState < BlockSummary [ ] > ( [ ] ) ;
626629 const [ loading , setLoading ] = useState ( true ) ;
0 commit comments