From 86d04e3c4ac0506e53adc4274d6d97e4b50b7026 Mon Sep 17 00:00:00 2001 From: alexander-sei Date: Fri, 4 Dec 2026 23:13:52 +0100 Subject: [PATCH 1/8] docs(giga): animate the remaining static Giga diagrams Turn the proposer comparison, lanes and cuts, slot pipeline, storage architecture, BUD window, and fee split into step players that match the other Giga diagrams, and reveal the roadmap track when it scrolls into view. Co-authored-by: Cursor --- snippets/giga-diagrams.jsx | 2122 +++++++++++++++++++++++++++--------- 1 file changed, 1627 insertions(+), 495 deletions(-) diff --git a/snippets/giga-diagrams.jsx b/snippets/giga-diagrams.jsx index 95b5ae9..78c15a5 100644 --- a/snippets/giga-diagrams.jsx +++ b/snippets/giga-diagrams.jsx @@ -12,6 +12,7 @@ export const GigaProposerComparison = () => { const ink = 'currentColor'; const accent = 'var(--sei-maroon-50)'; + const hairline = 'rgba(128, 128, 128, 0.25)'; const box = { fill: ink, fillOpacity: 0.05, stroke: ink, strokeOpacity: 0.35, strokeWidth: 1 }; const lanes = [0, 1, 2, 3]; const math = 'var(--sei-font-math)'; @@ -27,69 +28,245 @@ export const GigaProposerComparison = () => { }); return <>{parts}{rest ? {rest} : null}; }; + const steps = [ + { + title: 'One leader per height', + text: 'In Tendermint-style consensus, one leader proposes each block, and the other validators vote on it.' + }, + { + title: 'One block per round', + text: "Each round commits one block. A single proposer's bandwidth and connectivity cap the whole network's throughput each round." + }, + { + title: 'Every validator will propose', + text: "In Sei Giga, every validator will stream batches into its own lane at the same time. Dissemination is designed to scale with aggregate validator bandwidth instead of one leader's connection." + }, + { + title: 'One decision commits every lane', + text: 'Consensus will commit a cut of all lane tips in one slot. Committing a tip commits everything behind it, so a single decision will finalize many blocks of data.' + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const paint = reduced ? 'none' : 'fill 400ms ease, stroke 400ms ease, fill-opacity 400ms ease, stroke-opacity 400ms ease'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const slideIn = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : 'translate(-10px, 0px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + const dropIn = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : 'translate(0px, -14px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + return ( -
-
- - - - - - - - - - - Single proposer (Tendermint-style) - {lanes.map((i) => ( - - - V{i + 1} - - ))} - leader - {[0, 2, 3].map((i) => ( - - ))} - votes - - - block {tex('h', 11)} - one block per round - - {[0, 1, 2].map((i) => ( - - - {tex(['h-2', 'h-1', 'h'][i], 9.5)} - - ))} - throughput capped by one leader's bandwidth - - - - Multi-Proposer (Sei Giga) - {lanes.map((i) => ( - - - V{i + 1} - {[0, 1, 2].map((j) => ( - - - {j < 2 ? : null} +
+
+
+ + + + + + + + + + + Single proposer (Tendermint-style) + {lanes.map((i) => ( + + + V{i + 1} + + ))} + leader + {[0, 2, 3].map((i) => ( + + ))} + votes + + + block {tex('h', 11)} + one block per round + = 1)} data-sei-flow={playing && step === 1 ? 'on' : undefined} /> + {[0, 1, 2].map((i) => ( + + {i === 2 ? : null} + = 1, 350) : undefined}> + + {tex(['h-2', 'h-1', 'h'][i], 9.5)} - ))} + + ))} + = 1, 600)}>throughput capped by one leader's bandwidth + + + + Multi-Proposer (Sei Giga) + {lanes.map((i) => ( + + + V{i + 1} + {[0, 1, 2].map((j) => { + const tip = j === 2 && step >= 3; + return ( + + + = 2, j * 300 + i * 90)}> + {j > 0 ? : null} + + + + ); + })} + + ))} + = 2)}>every validator streams its own lane + = 3)}> + tips + + + = 3, 300)}> + + + cut of tips + one consensus slot + commits all lanes + + = 2, 900)}>designed to use aggregate validator bandwidth + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
One leader per height versus every validator proposing concurrently. In Giga, consensus will commit a cut of all lane tips, so a single decision will finalize many blocks of data.
@@ -351,24 +528,63 @@ export const GigaRoadmapTrack = () => { { l: 'Hermes testnet', s: 'next' }, { l: 'Hermes mainnet', s: 'next' } ]; + const [drawn, setDrawn] = useState(true); + const rootRef = useRef(null); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return undefined; + if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined; + if (node.getBoundingClientRect().top < window.innerHeight) return undefined; + setDrawn(false); + const observer = new IntersectionObserver( + (entries) => { + if (entries[entries.length - 1].intersectionRatio >= 0.3) { + setDrawn(true); + observer.disconnect(); + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const xOf = (i) => 70 + i * 80; + const reveal = (delay) => ({ opacity: drawn ? 1 : 0, transition: drawn ? `opacity 350ms ease ${delay}ms` : 'none' }); + const popIn = (delay) => ({ + opacity: drawn ? 1 : 0, + transformBox: 'fill-box', + transformOrigin: 'center', + transform: drawn ? 'scale(1)' : 'scale(0.4)', + transition: drawn ? `opacity 300ms ease ${delay}ms, transform 450ms cubic-bezier(0.34, 1.56, 0.64, 1) ${delay}ms` : 'none' + }); + const track = (s) => (s === 'done' ? { stroke: done, strokeWidth: 2.5 } : s === 'prog' ? { stroke: prog, strokeWidth: 2.5, strokeDasharray: '6 4' } : { stroke: ink, strokeOpacity: 0.25, strokeWidth: 2, strokeDasharray: '2 5' }); + return ( -
+
- - - + + {items.slice(1).map((it, k) => ( + + ))} + {items.map((it, i) => { - const x = 70 + i * 80; + const x = xOf(i); const above = i % 2 === 0; const c = it.s === 'done' ? done : it.s === 'prog' ? prog : ink; return ( - - {it.s === 'done' ? : null} - {it.s === 'prog' ? : null} - - {it.l} + + + {it.s === 'done' ? : null} + {it.s === 'prog' ? : null} + + + + {it.l} + ); })} @@ -388,8 +604,10 @@ export const GigaRoadmapTrack = () => { export const GigaLanesAndCuts = () => { const ink = 'currentColor'; const accent = 'var(--sei-maroon-50)'; - const box = { fill: ink, fillOpacity: 0.05, stroke: ink, strokeOpacity: 0.35, strokeWidth: 1 }; + const hairline = 'rgba(128, 128, 128, 0.25)'; const lanes = [0, 1, 2]; + const laneY = (i) => 74 + i * 72; + const boxX = (j) => 124 + j * 96; const math = 'var(--sei-font-math)'; const tex = (expr, size, rest) => { const drop = size * 0.24; @@ -403,126 +621,989 @@ export const GigaLanesAndCuts = () => { }); return <>{parts}{rest ? {rest} : null}; }; - return ( -
-
- - - - - - - - - - - committing a tip implicitly commits everything behind it - {lanes.map((i) => ( - - - V{i + 1} - {[0, 1, 2, 3].map((j) => ( - - - pos {j} - batch - {j < 3 ? : null} - - ))} - tip - - ))} - arrows: parentRef hash-chains each proposal to its predecessor - - - - paper: {tex('f + 1', 10.5)} replicas - stake-weighted in implementation - - - - - cut = [tip 1, tip 2, tip 3] - - - committed in one slot - Prepare, then Commit - - missing batch data is fetched after commit, - off the critical path - -
-
Each validator will chain batches into its own lane. The whitepaper uses f + 1 replica votes for availability. The implementation applies stake-weighted thresholds.
-
- ); -}; + const steps = [ + { + title: 'Stream lanes in parallel', + text: <>Each validator chains batches of transactions, called cars, into its own lane. A proposal is ⟨pos, batch, parentRef⟩, and parentRef is the hash of the previous proposal in the same lane. No lane waits for consensus or for another lane. + }, + { + title: 'Certify each batch', + text: <>Validators that receive a proposal check that it extends the lane and return a signed vote. With f + 1 matching votes, the proposer assembles a Proof of Availability (PoA). Under the whitepaper's assumptions, at least one honest replica then holds the data. The implementation applies stake-weighted thresholds. + }, + { + title: 'The newest certified proposal is the tip', + text: "Lanes keep growing. The latest proposal in a lane that holds a PoA is the lane's tip, and certifying it attests every earlier proposal in that lane. V3's newest proposal has no PoA yet, so V3's tip stays one position back." + }, + { + title: 'Commit a cut of tips', + text: "The slot's leader bundles every lane's latest certified tip into a cut. Replicas vote in a Prepare phase and then a Commit phase, so one slot commits the cut. They vote on compact certificates, not on full batches." + }, + { + title: 'Everything behind the cut commits', + text: "Lanes are hash-chained, so committing a tip commits everything behind it, and one decision can finalize many blocks of data. A replica that is missing batch data fetches it after commit, off the critical path. V3's uncertified proposal waits for a later cut." + } + ]; + const last = steps.length - 1; -export const GigaSlotPipeline = () => { - const ink = 'currentColor'; - const accent = 'var(--sei-maroon-50)'; - const slots = [0, 1, 2]; - const math = 'var(--sei-font-math)'; - const tex = (expr, size, rest) => { - const drop = size * 0.24; - let low = false; - const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => { - const sub = tok[0] === '_'; - const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok; - const shift = sub ? drop : low ? -drop : undefined; - low = sub; - return {body}; - }); - return <>{parts}{rest ? {rest} : null}; - }; - return ( -
-
- - - - - - - {slots.map((i) => { - const x = 130 + i * 105; - const y = 46 + i * 50; - return ( - - slot {tex(i > 0 ? 's+' + i : 's', 11)} - - Prepare (PrepareQC) - - Commit (CommitQC) - - ); - })} - - next slot starts once the Prepare message for {tex('s', 9.5)} is seen - - - 1 round trip - - +0.5 effective - steady state: one cut per 1.5 round trips - -
-
Slots will overlap: replicas will begin slot s + 1 as soon as they see the Prepare message for slot s. The target is an effective steady-state cadence of one committed cut per 1.5 network round trips, not per-transaction latency.
-
- ); -}; + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const paint = reduced ? 'none' : 'fill 400ms ease, stroke 400ms ease, fill-opacity 400ms ease, stroke-opacity 400ms ease'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const slideIn = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : 'translate(-10px, 0px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + const pop = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transformBox: 'fill-box', + transformOrigin: 'center', + transform: visible ? 'scale(1)' : 'scale(0.3)', + transition: reduced ? 'none' : `transform 350ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 250ms ease ${visible ? delay || 0 : 0}ms` + }); + const arrives = (j) => (j < 3 ? 0 : 2); + const certified = (i, j) => (j < 3 ? step >= 1 : i < 2 && step >= 2); + const waiting = (i, j) => i === 2 && j === 3; + const tipOf = (i) => (step >= 2 && i < 2 ? 3 : 2); + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + + return ( +
+
+
+ + + + + + + + + + = 4)} /> + = 4, 200)}>committing a tip implicitly commits everything behind it + + {lanes.map((i) => ( + + + V{i + 1} + {[0, 1, 2, 3].map((j) => { + const x = boxX(j); + const y = laneY(i); + const tip = step >= 1 && j === tipOf(i); + return ( + + + = arrives(j), j < 3 ? j * 260 + i * 90 : 150 + i * 160)}> + {j > 0 ? : null} + + pos {j} + {waiting(i, j) ? 'no PoA yet' : 'batch'} + + + + + + + ); + })} + = 1 ? 1 : 0, transform: `translate(${boxX(tipOf(i)) + 36}px, 0px)`, transition: reduced ? 'none' : `opacity 400ms ease ${step >= 1 ? 400 : 0}ms, transform 500ms ${ease} ${step >= 2 ? 750 : 0}ms` }}> + tip + + + ))} + arrows: parentRef hash-chains each proposal to its predecessor + + + = 1)}> + + + + Proof of Availability: {tex('f + 1', 10)} replica votes + in the whitepaper, stake-weighted in the implementation + + + = 3)} /> + + = 3, 250)}> + + + cut = [tip 1, tip 2, tip 3] + committed in one slot + Prepare, then Commit + + + + = 4, 400)}> + + missing batch data is fetched after commit, + off the critical path + + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
+
+
Each validator will chain batches into its own lane. The whitepaper uses f + 1 replica votes for availability. The implementation applies stake-weighted thresholds.
+
+ ); +}; + +export const GigaSlotPipeline = () => { + const ink = 'currentColor'; + const accent = 'var(--sei-maroon-50)'; + const hairline = 'rgba(128, 128, 128, 0.25)'; + const slots = [0, 1, 2]; + const math = 'var(--sei-font-math)'; + const tex = (expr, size, rest) => { + const drop = size * 0.24; + let low = false; + const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => { + const sub = tok[0] === '_'; + const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok; + const shift = sub ? drop : low ? -drop : undefined; + low = sub; + return {body}; + }); + return <>{parts}{rest ? {rest} : null}; + }; + const steps = [ + { + title: 'Prepare a cut', + text: <>The slot's leader bundles the latest certified tips into a cut proposal. Replicas validate the PoAs and broadcast prepare votes. At n − f votes, the votes form a PrepareQC. + }, + { + title: 'Commit it', + text: <>Replicas exchange commit votes over the PrepareQC. In the whitepaper's replica-count model, a CommitQC formed from n − f votes finalizes the cut. + }, + { + title: 'Start the next slot early', + text: <>Slots overlap. As soon as replicas see the Prepare message for slot s, they can begin slot s + 1. The next leader can propose while the previous cut is still in its commit phase. + }, + { + title: 'Reach the steady-state cadence', + text: 'With quadratic communication and pipelining, the design targets an effective steady-state cadence of one committed cut per 1.5 network round trips. Tendermint uses three full rounds. This is a throughput cadence, not a per-transaction finality guarantee.' + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const grow = (on, delay) => ({ + transformBox: 'fill-box', + transformOrigin: 'left center', + transform: `scaleX(${on ? 1 : 0})`, + transition: reduced ? 'none' : on ? `transform 650ms ${ease} ${delay}ms` : 'transform 250ms ease' + }); + const label = (on, delay) => ({ opacity: on ? 1 : 0, transition: reduced ? 'none' : on ? `opacity 300ms ease ${delay + 350}ms` : 'opacity 200ms ease' }); + const prepareOn = (i) => i === 0 || step >= 2; + const commitOn = (i) => (i === 0 ? step >= 1 : step >= 2); + const prepareAt = (i) => (i === 0 ? 0 : (i - 1) * 700); + const commitAt = (i) => (i === 0 ? 0 : (i - 1) * 700 + 500); + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + + return ( +
+
+
+ + + + + + + {slots.map((i) => { + const x = 130 + i * 105; + const y = 46 + i * 50; + return ( + + slot {tex(i > 0 ? 's+' + i : 's', 11)} + + + + Prepare (PrepareQC) + + Commit (CommitQC) + + ); + })} + = 2)}> + + slot {tex('s+1', 9.5)} starts once the Prepare message for slot {tex('s', 9.5)} is seen + + + = 3)}> + + 1 round trip + + = 3, 350)}> + + +0.5 effective + + = 3, 700)}>steady state: one cut per 1.5 round trips + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
+
+
Slots will overlap: replicas will begin slot s + 1 as soon as they see the Prepare message for slot s. The target is an effective steady-state cadence of one committed cut per 1.5 network round trips, not per-transaction latency.
+
+ ); +}; export const GigaAttestationFlow = () => { const ink = 'currentColor'; const accent = 'var(--sei-maroon-50)'; const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; const hairline = 'rgba(128, 128, 128, 0.25)'; - const blocks = [ - { b: 'n-1', from: 0 }, - { b: 'n', from: 0 }, - { b: 'n+1', from: 1 }, - { b: 'n+2', from: 2 }, - { b: 'n+x', from: 4 } - ]; + const blocks = [ + { b: 'n-1', from: 0 }, + { b: 'n', from: 0 }, + { b: 'n+1', from: 1 }, + { b: 'n+2', from: 2 }, + { b: 'n+x', from: 4 } + ]; + const math = 'var(--sei-font-math)'; + const tex = (expr, size, rest) => { + const drop = size * 0.24; + let low = false; + const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => { + const sub = tok[0] === '_'; + const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok; + const shift = sub ? drop : low ? -drop : undefined; + low = sub; + return {body}; + }); + return <>{parts}{rest ? {rest} : null}; + }; + const stages = [ + { x: 96, label: <>execute block {tex('n', 10.5)}, sub: 'deterministic Apply', from: 1 }, + { x: 296, label: 'write log', sub: 'last write wins', from: 2 }, + { x: 496, label: tex('d_n = LtHash(...)', 10.5), sub: 'writes, receipts, gas', from: 3 } + ]; + + const steps = [ + { + title: 'Order the block', + text: <>Consensus fixes the position of block n. Its order is final, but nothing in it has executed yet. + }, + { + title: 'Execute it', + text: <>Every node applies block n to the same starting state. Execution is deterministic, so conforming nodes derive the same result without communicating. Ordering meanwhile moves on to block n + 1. + }, + { + title: 'Resolve the write log', + text: 'If the block writes a key more than once, the last write wins. The digest covers the surviving writes, the receipts, and the gas accounting.' + }, + { + title: 'Hash it into a digest', + text: <>A lattice hash, LtHash, combines those records into dn. Validators sign a compact commitment to it, the digest Dn. + }, + { + title: 'Attest in a later block', + text: <>Once validators with two-thirds of voting power have signed Dn, a later block, n + x, includes the attestation. This is state attestation finality for block n. + }, + { + title: 'Contain divergence', + text: 'Signing two different digests for the same block is slashable equivocation. Divergence below one-third of voting power can be isolated. Beyond one-third, the chain is designed to halt.' + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const slideIn = (visible, dx, dy, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : `translate(${dx}px, ${dy}px)`, + transition: reduced ? 'none' : `transform 600ms cubic-bezier(0.4, 0, 0.2, 1) ${delay || 0}ms, opacity 400ms ease ${delay || 0}ms` + }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const attested = step >= 4; + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + + return ( +
+
+
+ + + + + + + + + + + {blocks.map((blk, i) => (blk.from > 0 ? : null))} + {stages.map((s) => ( + + ))} + + + + {blocks.map((blk, i) => { + const isN = i === 1; + const later = i === 4; + return ( + = blk.from, -16, 0)}> + {i > 0 ? : null} + + block {tex(blk.b, 11)} + + ); + })} + ordering final + state attestation final + + = 1, 0, -8)} /> + {stages.map((s, i) => ( + = s.from, -12, 0)}> + {i > 0 ? : null} + + {s.label} + {s.sub} + + ))} + = 3, -12, 0, 250)}> + + + digest {tex('D_n', 10.5)} + compact commitment + + + + 2/3 voting power, + included in block {tex('n+x', 9.5)} + + + = 5, 0, 10)}> + + signing two different digests for the same block is slashable equivocation; + divergence under 1/3 of voting power can be isolated; over 1/3 is designed to halt the chain + + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
+
+
Execution results will be committed as a lattice-hash digest rather than a state root. Validators will attest to that digest a bounded number of blocks later.
+
+ ); +}; + +export const GigaOccDiagram = () => { + const ink = 'currentColor'; + const accent = 'var(--sei-maroon-50)'; + const hairline = 'rgba(128, 128, 128, 0.25)'; + const workers = ['worker 1', 'worker 2', 'worker 3']; + const rowY = (w) => 50 + w * 66; + const runs = [ + { id: 't1', w: 0, x: 126, len: 100, label: 't1', from: 0, delay: 0 }, + { id: 't2', w: 1, x: 126, len: 180, label: 't2 writes k', from: 0, delay: 0 }, + { id: 't3', w: 2, x: 126, len: 190, label: 't3', from: 0, delay: 0 }, + { id: 't4', w: 0, x: 236, len: 120, label: 't4 reads k', from: 1, delay: 0 }, + { id: 't5', w: 1, x: 316, len: 110, label: 't5', from: 1, delay: 280 }, + { id: 't4r', w: 0, x: 384, len: 130, label: 't4 re-executes', from: 3, delay: 0 } + ]; + + const steps = [ + { + title: 'Start in parallel', + text: "Workers start the block's transactions in parallel. Each transaction buffers its writes privately, so nothing reaches shared state yet." + }, + { + title: 'Read a value that is about to change', + text: "As workers free up, they take t4 and t5. t4 reads k while t2, which comes earlier in the block, is still running. t4 sees the value from before t2's write." + }, + { + title: 'Validate against earlier writes', + text: "Validation checks whether an earlier transaction in the block wrote to anything a later one read. t2 wrote k after t4 began, so t4's read is stale. The other transactions pass." + }, + { + title: 'Re-execute only the conflict', + text: "Only t4 rolls back and runs again, this time reading t2's value of k. Every other transaction keeps its first result." + }, + { + title: 'Commit in block order', + text: 'Results commit in block order, so the outcome is identical to sequential execution. Under sustained contention, the sei-chain scheduler retries a transaction up to 10 times, then falls back to sequential execution.' + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const fade = reduced ? 'none' : 'opacity 400ms ease'; + const shown = (visible) => ({ opacity: visible ? 1 : 0, transition: fade }); + const grow = (on, run) => ({ + transformBox: 'fill-box', + transformOrigin: 'left center', + transform: `scaleX(${on ? 1 : 0})`, + transition: reduced ? 'none' : on ? `transform ${run.len * 3.5}ms linear ${run.delay}ms` : 'transform 250ms ease' + }); + const label = (on, run) => ({ opacity: on ? 1 : 0, transition: reduced ? 'none' : on ? `opacity 300ms ease ${run.delay + 150}ms` : 'opacity 200ms ease' }); + + const stale = step >= 2; + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + + return ( +
+
+
+ + + + + + + + + + {workers.map((w, i) => ( + + {w} + + + ))} + + {runs.map((run) => { + const on = step >= run.from; + const isStale = run.id === 't4' && stale; + const redo = run.id === 't4r'; + return ( + + + {run.label} + + ); + })} + + = 1)}> + + + + t2 is still running + + + + + conflict + validation caught the stale read + + + = 3)} /> + + = 4)}> + + + commit in block order + result identical to + sequential execution + only conflicting transactions re-run; after 10 retries the implementation falls back to sequential execution + + + + time + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
+
+
All transactions in a block will start in parallel with private write buffers. Validation will re-execute only those whose reads collided with an earlier transaction's writes.
+
+ ); +}; + +export const GigaStorageArchitecture = () => { + const ink = 'currentColor'; + const accent = 'var(--sei-maroon-50)'; + const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; + const hairline = 'rgba(128, 128, 128, 0.25)'; const math = 'var(--sei-font-math)'; const tex = (expr, size, rest) => { const drop = size * 0.24; @@ -536,36 +1617,30 @@ export const GigaAttestationFlow = () => { }); return <>{parts}{rest ? {rest} : null}; }; - const stages = [ - { x: 96, label: <>execute block {tex('n', 10.5)}, sub: 'deterministic Apply', from: 1 }, - { x: 296, label: 'write log', sub: 'last write wins', from: 2 }, - { x: 496, label: tex('d_n = LtHash(...)', 10.5), sub: 'writes, receipts, gas', from: 3 } - ]; - const steps = [ { - title: 'Order the block', - text: <>Consensus fixes the position of block n. Its order is final, but nothing in it has executed yet. + title: 'Serve reads from RAM', + text: 'Frequently accessed state will be held in RAM, so execution reads are served from memory in the common case.' }, { - title: 'Execute it', - text: <>Every node applies block n to the same starting state. Execution is deterministic, so conforming nodes derive the same result without communicating. Ordering meanwhile moves on to block n + 1. + title: 'Write to a flat store', + text: 'Every account, storage slot, and global variable will map directly to an entry in a log-structured merge (LSM) tree. Writes skip per-write Merkle path updates, so nothing is re-hashed on the write path.' }, { - title: 'Resolve the write log', - text: 'If the block writes a key more than once, the last write wins. The digest covers the surviving writes, the receipts, and the gas accounting.' + title: 'Persist asynchronously', + text: 'All disk writes will be asynchronous and exist only for durability. An append-only write-ahead log (WAL) protects them and is replayed on crash recovery.' }, { - title: 'Hash it into a digest', - text: <>A lattice hash, LtHash, combines those records into dn. Validators sign a compact commitment to it, the digest Dn. + title: 'Tier by age', + text: 'Recent and hot data will sit on local high-performance SSDs. Historical data will move to a distributed columnar store built for analytical queries and audit workloads.' }, { - title: 'Attest in a later block', - text: <>Once validators with two-thirds of voting power have signed Dn, a later block, n + x, includes the attestation. This is state attestation finality for block n. + title: 'Commit with a lattice hash', + text: <>Instead of a state root, each block's write log will be committed with LtHash, a homomorphic multiset hash, as dn. The digest updates incrementally as writes commit, in any order, with no tree walk. }, { - title: 'Contain divergence', - text: 'Signing two different digests for the same block is slashable equivocation. Divergence below one-third of voting power can be isolated. Beyond one-third, the chain is designed to halt.' + title: 'Attest it and settle disputes', + text: <>Validators attest the compact commitment Dn with two-thirds of voting power. In a dispute, divergent executors compare chunk digests, bisect the key space, and replay only the affected range. } ]; const last = steps.length - 1; @@ -630,13 +1705,14 @@ export const GigaAttestationFlow = () => { setPlaying(true); }; - const slideIn = (visible, dx, dy, delay) => ({ + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const slideIn = (visible, delay) => ({ opacity: visible ? 1 : 0, - transform: visible ? 'translate(0px, 0px)' : `translate(${dx}px, ${dy}px)`, - transition: reduced ? 'none' : `transform 600ms cubic-bezier(0.4, 0, 0.2, 1) ${delay || 0}ms, opacity 400ms ease ${delay || 0}ms` + transform: visible ? 'translate(0px, 0px)' : 'translate(0px, -8px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` }); - const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); - const attested = step >= 4; + const flow = (at) => (playing && step === at ? 'on' : undefined); const primaryButton = { backgroundColor: 'var(--sei-maroon-100)', @@ -666,62 +1742,72 @@ export const GigaAttestationFlow = () => {
- + - + - - - - {blocks.map((blk, i) => (blk.from > 0 ? : null))} - {stages.map((s) => ( - - ))} - - + + + + + + + + - {blocks.map((blk, i) => { - const isN = i === 1; - const later = i === 4; - return ( - = blk.from, -16, 0)}> - {i > 0 ? : null} - - block {tex(blk.b, 11)} - - ); - })} - ordering final - state attestation final - = 1, 0, -8)} /> - {stages.map((s, i) => ( - = s.from, -12, 0)}> - {i > 0 ? : null} - - {s.label} - {s.sub} - - ))} - = 3, -12, 0, 250)}> - - - digest {tex('D_n', 10.5)} - compact commitment + state path + + execution: reads served from RAM + = 1)}> + + + flat key-value store (LSM tree) + no per-write Merkle updates - - - 2/3 voting power, - included in block {tex('n+x', 9.5)} + = 2)}> + + async + + append-only WAL + crash recovery + + = 3)}> + + + hot tier: local high-performance SSDs + + = 3, 450)}> + + + cold tier: distributed columnar store - = 5, 0, 10)}> - - signing two different digests for the same block is slashable equivocation; - divergence under 1/3 of voting power can be isolated; over 1/3 is designed to halt the chain + commitment path + = 4)}> + + each block's writes + + write log of block {tex('n', 10.5)} + + = 4, 450)}> + + + lattice hash {tex('d_n', 10.5, ' (LtHash)')} + incremental, order-independent + + = 5)}> + + + {tex('D_n', 10.5, ' attested by 2/3 voting power')} + + = 5, 450)}> + + disputes: compare chunk digests, + bisect, replay one range
@@ -767,46 +1853,54 @@ export const GigaAttestationFlow = () => { ))}
-
Execution results will be committed as a lattice-hash digest rather than a state root. Validators will attest to that digest a bounded number of blocks later.
+
In the proposed architecture, the write path avoids Merkle-tree updates. State lives in a RAM-first flat store with an append-only WAL. Commitments come from a homomorphic lattice hash over each block's write log.
); }; -export const GigaOccDiagram = () => { +export const GigaBudWindow = () => { const ink = 'currentColor'; const accent = 'var(--sei-maroon-50)'; + const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; const hairline = 'rgba(128, 128, 128, 0.25)'; - const workers = ['worker 1', 'worker 2', 'worker 3']; - const rowY = (w) => 50 + w * 66; - const runs = [ - { id: 't1', w: 0, x: 126, len: 100, label: 't1', from: 0, delay: 0 }, - { id: 't2', w: 1, x: 126, len: 180, label: 't2 writes k', from: 0, delay: 0 }, - { id: 't3', w: 2, x: 126, len: 190, label: 't3', from: 0, delay: 0 }, - { id: 't4', w: 0, x: 236, len: 120, label: 't4 reads k', from: 1, delay: 0 }, - { id: 't5', w: 1, x: 316, len: 110, label: 't5', from: 1, delay: 280 }, - { id: 't4r', w: 0, x: 384, len: 130, label: 't4 re-executes', from: 3, delay: 0 } - ]; - + const leaves = ['(key a, value, n, prev)', '(key b, value, n, prev)', '(key c, value, n, prev)']; + const math = 'var(--sei-font-math)'; + const tex = (expr, size, rest) => { + const drop = size * 0.24; + let low = false; + const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => { + const sub = tok[0] === '_'; + const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok; + const shift = sub ? drop : low ? -drop : undefined; + low = sub; + return {body}; + }); + return <>{parts}{rest ? {rest} : null}; + }; const steps = [ { - title: 'Start in parallel', - text: "Workers start the block's transactions in parallel. Each transaction buffers its writes privately, so nothing reaches shared state yet." + title: "Sort the block's writes", + text: <>Every state entry will carry its last-modified height. For block n, each write becomes a leaf (key, newValue, n, prevHeight), and the leaves are sorted by key. }, { - title: 'Read a value that is about to change', - text: "As workers free up, they take t4 and t5. t4 reads k while t2, which comes earlier in the block, is still running. t4 sees the value from before t2's write." + title: 'Root them into a BUD', + text: <>The Block Update Digest Un is the Merkle root over that block's leaves only. Its cost scales with how much the block changed, not with total state size. }, { - title: 'Validate against earlier writes', - text: "Validation checks whether an earlier transaction in the block wrote to anything a later one read. t2 wrote k after t4 began, so t4's read is stale. The other transactions pass." + title: 'Attest it with the digest', + text: <>Validators attest Un on the same delayed two-thirds voting-power schedule as the divergence digest Dn. }, { - title: 'Re-execute only the conflict', - text: "Only t4 rolls back and runs again, this time reading t2's value of k. Every other transaction keeps its first result." + title: 'Prove a value', + text: <>A membership proof is a Merkle path to an attested Un. It certifies that key held value right after block n. Two proofs at heights a and b, where the b-leaf records predecessor a, prove the key was unmodified in between. }, { - title: 'Commit in block order', - text: 'Results commit in block order, so the outcome is identical to sequential execution. Under sustained contention, the sei-chain scheduler retries a transaction up to 10 times, then falls back to sequential execution.' + title: 'Cover long ranges with SuperBUDs', + text: <>SuperBUDs aggregate BUDs over exponentially growing windows, with branching base e and maximum level Lmax set by governance. The guaranteed proof window is η = eLmax blocks. Archive nodes can serve older claims, outside the protocol guarantee. + }, + { + title: 'Keep proof anchors fresh', + text: <>Touch transactions rewrite only a key's last-modified metadata, which gives a long-untouched key a fresh proof anchor. Deletions leave tombstones, which anchor exclusion proofs and are garbage-collected after η. } ]; const last = steps.length - 1; @@ -871,17 +1965,15 @@ export const GigaOccDiagram = () => { setPlaying(true); }; - const fade = reduced ? 'none' : 'opacity 400ms ease'; - const shown = (visible) => ({ opacity: visible ? 1 : 0, transition: fade }); - const grow = (on, run) => ({ - transformBox: 'fill-box', - transformOrigin: 'left center', - transform: `scaleX(${on ? 1 : 0})`, - transition: reduced ? 'none' : on ? `transform ${run.len * 3.5}ms linear ${run.delay}ms` : 'transform 250ms ease' + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const slideIn = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : 'translate(-10px, 0px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` }); - const label = (on, run) => ({ opacity: on ? 1 : 0, transition: reduced ? 'none' : on ? `opacity 300ms ease ${run.delay + 150}ms` : 'opacity 200ms ease' }); - - const stale = step >= 2; + const flow = (at) => (playing && step === at ? 'on' : undefined); const primaryButton = { backgroundColor: 'var(--sei-maroon-100)', @@ -904,67 +1996,72 @@ export const GigaOccDiagram = () => { padding: '6px 12px', borderRadius: '6px', opacity: disabled ? 0.4 : 1, - cursor: disabled ? 'default' : 'pointer' - }); - - return ( -
-
-
- - - - - - - - - - {workers.map((w, i) => ( - - {w} - - - ))} - - {runs.map((run) => { - const on = step >= run.from; - const isStale = run.id === 't4' && stale; - const redo = run.id === 't4r'; - return ( - - - {run.label} - - ); - })} - - = 1)}> - - - - t2 is still running + cursor: disabled ? 'default' : 'pointer' + }); - - - - conflict - validation caught the stale read + return ( +
+
+
+ + + + + + + + + + - = 3)} /> + this block's writes, sorted by key + {leaves.map((l, i) => ( + + + {l} + = 1, i * 120)} data-sei-flow={flow(1)} /> + + ))} + = 1, 350)}> + + root {tex('U_n', 10.5)} + + = 2)}> + + + attested with {tex('D_n', 10)} + same 2/3 voting-power schedule + + = 3)}> + + + proof = Merkle path to attested {tex('U_n', 9.5, ';')} + two proofs bracket an unmodified span + cost scales with the block's updates + = 4)}> - - - commit in block order - result identical to - sequential execution - only conflicting transactions re-run; after 10 retries the implementation falls back to sequential execution + + {Array.from({ length: 17 }, (_, i) => ( + + ))} + blocks - - - time + {[0, 1, 2, 3].map((i) => ( + = 4, 250 + i * 180)} /> + ))} + = 4, 300)}>SuperBUD, {tex('e', 9)} blocks + = 4, 1100)}> + + + guaranteed proof window: the last {tex('e', 9.5)} + L + max + blocks (governance-set); older claims need archive nodes + + + = 5)}>touch transactions refresh a stale key's anchor; deletions leave tombstones for exclusion proofs
@@ -1009,141 +2106,6 @@ export const GigaOccDiagram = () => { ))}
-
All transactions in a block will start in parallel with private write buffers. Validation will re-execute only those whose reads collided with an earlier transaction's writes.
-
- ); -}; - -export const GigaStorageArchitecture = () => { - const ink = 'currentColor'; - const accent = 'var(--sei-maroon-50)'; - const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; - const math = 'var(--sei-font-math)'; - const tex = (expr, size, rest) => { - const drop = size * 0.24; - let low = false; - const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => { - const sub = tok[0] === '_'; - const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok; - const shift = sub ? drop : low ? -drop : undefined; - low = sub; - return {body}; - }); - return <>{parts}{rest ? {rest} : null}; - }; - return ( -
-
- - - - - - - state path - - execution: reads served from RAM - - - flat key-value store (LSM tree) - no per-write Merkle updates - - append-only WAL - crash recovery - - async - - - hot tier: local high-performance SSDs - - - cold tier: distributed columnar store - - commitment path - - write log of block {tex('n', 10.5)} - - - lattice hash {tex('d_n', 10.5, ' (LtHash)')} - incremental, order-independent - - - {tex('D_n', 10.5, ' attested by 2/3 voting power')} - - disputes: compare chunk digests, - bisect, replay one range - -
-
In the proposed architecture, the write path avoids Merkle-tree updates. State lives in a RAM-first flat store with an append-only WAL. Commitments come from a homomorphic lattice hash over each block's write log.
-
- ); -}; - -export const GigaBudWindow = () => { - const ink = 'currentColor'; - const accent = 'var(--sei-maroon-50)'; - const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; - const leaves = ['(key a, value, n, prev)', '(key b, value, n, prev)', '(key c, value, n, prev)']; - const math = 'var(--sei-font-math)'; - const tex = (expr, size, rest) => { - const drop = size * 0.24; - let low = false; - const parts = expr.match(/_\{[^}]*\}|_[A-Za-z0-9]|[A-Za-z]+|[0-9.]+|[-+=]|[^\sA-Za-z0-9_.+=-]/g).map((tok, i) => { - const sub = tok[0] === '_'; - const body = sub ? tok.replace(/^_\{?|\}$/g, '') : /^[-+=]$/.test(tok) ? '\u2005' + tok.replace('-', '\u2212') + '\u2005' : tok; - const shift = sub ? drop : low ? -drop : undefined; - low = sub; - return {body}; - }); - return <>{parts}{rest ? {rest} : null}; - }; - return ( -
-
- - - - - - - {leaves.map((l, i) => ( - - - {l} - - - ))} - this block's writes, sorted by key - - root {tex('U_n', 10.5)} - - - attested with {tex('D_n', 10)} - same 2/3 voting-power schedule - - proof = Merkle path to attested {tex('U_n', 9.5, ';')} - two proofs bracket an unmodified span - cost scales with the block's updates - - - {Array.from({ length: 17 }, (_, i) => ( - - ))} - blocks - {[0, 1, 2, 3].map((i) => ( - - ))} - SuperBUD, {tex('e', 9)} blocks - - - guaranteed proof window: the last {tex('e', 9.5)} - L - max - blocks (governance-set); older claims need archive nodes - - touch transactions refresh a stale key's anchor; deletions leave tombstones for exclusion proofs - -
Every block will get a Merkle root over only its own updates. SuperBUDs will aggregate those roots over exponentially sized windows so provers can cover long ranges with a few digests.
); @@ -1878,31 +2840,201 @@ export const GigaFeeSplit = () => { const ink = 'currentColor'; const accent = 'var(--sei-maroon-50)'; const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; + const hairline = 'rgba(128, 128, 128, 0.25)'; const parts = [ { x: 60, w: 300, label: 'execution fee', sub: '1559-style base fee', to: 'pays for gas actually consumed', c: null }, - { x: 360, w: 240, label: 'ordering fee (tip)', sub: 'buys a position in the order', to: 'socialised: epoch pool, stake x liveness', c: 'accent' }, + { x: 360, w: 240, label: 'ordering fee (tip)', sub: 'buys a position in the order', to: 'socialised: epoch pool, stake × liveness', c: 'accent' }, { x: 600, w: 200, label: 'distribution fee', sub: 'prices duplicate copies', to: 'only one copy executes; partial refund', c: 'gold' } ]; + + const steps = [ + { + title: 'Execution fee', + text: <>An EIP-1559-style dynamic base fee will pay for the gas the transaction consumes. eth_feeHistory and eth_maxPriorityFeePerGas will remain your estimation tools. + }, + { + title: 'Ordering fee', + text: 'The priority fee will buy a position in the merged order. Lanes in each committed cut will be ordered by their highest included tip, so a higher tip buys earlier execution.' + }, + { + title: 'Distribution fee', + text: 'Each duplicate copy that you submit for censorship resistance will pay a distribution fee. Only one copy executes, and the other copies get part of the tip back.' + }, + { + title: 'Tips are socialised', + text: 'Priority fees will be pooled per epoch and distributed to validators by stake and liveness. The proposer that carried the transaction is not paid directly.' + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const slideIn = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : 'translate(0px, -10px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + return ( -
-
- - {parts.map((p) => { - const fill = p.c === 'accent' ? accent : p.c === 'gold' ? gold : ink; - const op = p.c ? 0.16 : 0.06; - return ( - - - {p.label} - {p.sub} - - {p.to} - - ); - })} - one transaction, three priced things - the protocol pools tips and does not pay the carrying proposer directly - +
+
+
+ + + + + + + + one signed transaction + {parts.map((p, k) => { + const fill = p.c === 'accent' ? accent : p.c === 'gold' ? gold : ink; + const cx = p.x + (p.w - 8) / 2; + return ( + + + = k)} data-sei-flow={playing && step === k ? 'on' : undefined} /> + = k, 250)}> + + {p.label} + {p.sub} + + = k, 650)}> + + {p.to} + + + ); + })} + = 3, 200)}>the protocol pools tips and does not pay the carrying proposer directly + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
Execution, ordering, and duplicate distribution will be priced separately. The tip will be strictly enforced for ordering and then socialised across the validator set.
From f24e3dae0196f82ee7ba0e53aa5e604e21e8f9cb Mon Sep 17 00:00:00 2001 From: alexander-sei Date: Fri, 4 Dec 2026 23:16:23 +0100 Subject: [PATCH 2/8] docs(ai): keep the agentic wallet diagram to what the page says about keys and policies The signing step now says the TEE applies to managed wallets such as Privy, and that a self-custodial ViemWalletProvider has no TEE. The policy check drops the network rule, because chain restriction is not a Privy policy condition. Co-authored-by: Cursor --- snippets/agentic-wallet-diagrams.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snippets/agentic-wallet-diagrams.jsx b/snippets/agentic-wallet-diagrams.jsx index a27d1e6..fa87801 100644 --- a/snippets/agentic-wallet-diagrams.jsx +++ b/snippets/agentic-wallet-diagrams.jsx @@ -30,11 +30,11 @@ export const AgenticWalletFlow = () => { }, { title: 'The policy engine checks it', - text: 'Spending limits, address allowlists, and network rules run before anything is signed.' + text: 'Spending limits, address allowlists, and other guardrails run before anything is signed.' }, { title: 'The TEE signs', - text: 'The private key stays inside a Trusted Execution Environment (TEE). The signer hands back only the signed transaction.' + text: <>In a managed wallet such as Privy, the private key stays inside a Trusted Execution Environment (TEE), and the signer hands back only the signed transaction. With a self-custodial ViemWalletProvider, you hold the key yourself and there is no TEE. }, { title: "Broadcast to Sei's EVM RPC", @@ -193,7 +193,7 @@ export const AgenticWalletFlow = () => { = 2 && !rejected, 200)}> ✓ spending limit ✓ allowlist - ✓ network + ✓ other guardrails ✕ over the spending limit From 72847e7c322bef6b5c3d98f60fe7fb8228ae5ef9 Mon Sep 17 00:00:00 2001 From: alexander-sei Date: Fri, 4 Dec 2026 23:23:48 +0100 Subject: [PATCH 3/8] docs(evm): animate the remaining nonce-lane diagrams Turn the two-dimensional nonce, EIP-7702 delegation, relayer pipeline, and failure isolation diagrams into step players, and grow the three benchmark charts in when they first scroll into view. Co-authored-by: Cursor --- snippets/nonce-lane-diagrams.jsx | 1246 ++++++++++++++++++++++++------ 1 file changed, 1020 insertions(+), 226 deletions(-) diff --git a/snippets/nonce-lane-diagrams.jsx b/snippets/nonce-lane-diagrams.jsx index a43c259..a545428 100644 --- a/snippets/nonce-lane-diagrams.jsx +++ b/snippets/nonce-lane-diagrams.jsx @@ -241,74 +241,248 @@ export const NonceLanes = () => { const math = 'var(--sei-font-math)'; const ok = 'var(--sei-diagram-ok, #1a7a00)'; const bad = 'var(--sei-diagram-error, #c20a00)'; - const chip = (x, y, label, state, key) => { + const hairline = 'rgba(128, 128, 128, 0.25)'; + + const steps = [ + { + title: 'One nonce, two halves', + text: 'EntryPoint v0.8 stores a UserOperation nonce as one uint256: a 192-bit key in the high bits and a 64-bit sequence in the low bits. The repository calls a key a lane.' + }, + { + title: 'Each lane keeps its own sequence', + text: 'The EntryPoint keeps one sequence counter per lane. Operations on the same lane stay strictly sequential, so the implementation allows at most one in-flight operation per lane.' + }, + { + title: 'A revert still consumes its sequence', + text: 'An operation that executes and reverts still consumes its lane sequence. Lane 2 moves on to sequence 2.' + }, + { + title: 'A fresh lane is valid immediately', + text: 'A new lane costs nothing to open. It starts at sequence 0 and is valid immediately.' + }, + { + title: 'Lanes never wait on each other', + text: 'Operations on different lanes have no ordering relationship. Whatever happens on one lane, the others stay valid.' + }, + { + title: 'Lane 0 is rejected', + text: 'LaneAccount rejects lane 0. Most SDKs pick key 0 when you do not pass one, and work that lands entirely on key 0 is a single queue again.' + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const slideIn = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : 'translate(-10px, 0px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + const chip = (x, y, label, state, at, delay) => { const c = state === 'ok' ? ok : state === 'bad' ? bad : ink; return ( - - - {label} + + + = at, delay)}> + + {label} + ); }; + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); return ( -
-
- - - - - - - - One uint256 nonce, two dimensions - bit 255 - bit 64 - bit 0 - - uint192 key: the lane - - any value from 1 to 2 - 192 - {'\u2005\u2212\u20051'} - , chosen by the caller - - - uint64 sequence - kept by the EntryPoint per lane - nonce = (lane << 64) | sequence - - - The EntryPoint keeps one sequence counter per lane - - lane 0 - - rejected by LaneAccount: SDKs default to key 0, and work on key 0 is one queue again - - lane 1 - {chip(120, 210, 'seq 0', 'ok', 'l1s0')} - {chip(172, 210, 'seq 1', 'ok', 'l1s1')} - {chip(224, 210, 'seq 2', 'ok', 'l1s2')} - {chip(276, 210, 'next 3', 'next', 'l1n')} - three operations landed in order - - lane 2 - {chip(120, 246, 'seq 0', 'ok', 'l2s0')} - {chip(172, 246, 'seq 1', 'bad', 'l2s1')} - {chip(224, 246, 'next 2', 'next', 'l2n')} - seq 1 executed and reverted: it still consumed its sequence - - lane 3 - {chip(120, 282, 'next 0', 'next', 'l3n')} - a fresh lane starts at 0 and is valid immediately - - - no ordering between lanes - whatever happens on one lane, - the others stay valid - - - strictly ordered within a lane, left to right - +
+
+
+ + + + + + + + One uint256 nonce, two dimensions + bit 255 + bit 64 + bit 0 + + uint192 key: the lane + + any value from 1 to 2 + 192 + {'\u2005\u2212\u20051'} + , chosen by the caller + + + uint64 sequence + kept by the EntryPoint per lane + nonce = (lane << 64) | sequence + + + = 1)}>The EntryPoint keeps one sequence counter per lane + + = 5)}> + lane 0 + + rejected by LaneAccount: SDKs default to key 0, and work on key 0 is one queue again + + + = 1)}>lane 1 + {chip(120, 210, 'seq 0', 'ok', 1, 0)} + {chip(172, 210, 'seq 1', 'ok', 1, 300)} + {chip(224, 210, 'seq 2', 'ok', 1, 600)} + {chip(276, 210, 'next 3', 'next', 1, 900)} + = 1, 1000)}>three operations landed in order + + = 2)}>lane 2 + {chip(120, 246, 'seq 0', 'ok', 2, 0)} + {chip(172, 246, 'seq 1', 'bad', 2, 350)} + {chip(224, 246, 'next 2', 'next', 2, 700)} + = 2, 800)}>seq 1 executed and reverted: it still consumed its sequence + + = 3)}>lane 3 + {chip(120, 282, 'next 0', 'next', 3, 150)} + = 3, 400)}>a fresh lane starts at 0 and is valid immediately + + = 4)}> + + no ordering between lanes + whatever happens on one lane, + the others stay valid + + + = 1, 1100)}> + + strictly ordered within a lane, left to right + + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
EntryPoint v0.8 stores a UserOperation nonce as a 192-bit key plus a 64-bit sequence and tracks one sequence per key. Operations on different keys never queue behind each other. Operations on the same key stay sequential. The repository calls a key a lane and forbids lane 0.
@@ -319,119 +493,486 @@ export const NonceLaneDelegation = () => { const ink = 'currentColor'; const accent = 'var(--sei-maroon-50)'; const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; + const hairline = 'rgba(128, 128, 128, 0.25)'; const box = { fill: ink, fillOpacity: 0.05, stroke: ink, strokeOpacity: 0.35, strokeWidth: 1 }; + + const steps = [ + { + title: 'Start from the funded EOA', + text: 'The funded account keeps its address, its native SEI balance, its token balances, and its venue approvals. The same private key signs every UserOperation.' + }, + { + title: 'Install the delegation designator', + text: <>One type-4 transaction writes 0xef0100 followed by the LaneAccount address into the EOA's code slot. A self-sponsored delegation advances the account's EVM nonce by two. After that, the submission path signs only UserOperations, so the EVM nonce stops moving. + }, + { + title: 'The EntryPoint calls the account', + text: <>The EntryPoint v0.8 singleton at 0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108 checks the signature, the lane sequence, and the prefund. Then handleOps calls execute(target, value, data) on the EOA. + }, + { + title: "The EOA runs LaneAccount's code", + text: "The EVM runs LaneAccount's code in the EOA's context. LaneAccount inherits the reference Simple7702Account and adds one rule: lane 0 is rejected." + }, + { + title: 'The venue sees the funded address', + text: <>LaneAccount.execute reaches the venue with the funded EOA as msg.sender. tx.origin is the relayer that paid for gas. + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const slideIn = (visible, dx, dy, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : `translate(${dx}px, ${dy}px)`, + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + const flow = (at) => (playing && step === at ? 'on' : undefined); + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + return ( -
-
- - - - - - - - - - - - Funded EOA, same address - same native SEI balance - same token balances and venue approvals - same private key signs every UserOperation - EVM nonce: a self-sponsored delegation spends two, - then it is frozen on the submission path - - code slot (delegation designator) - 0xef0100 || LaneAccount address - - - EntryPoint v0.8 singleton - 0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108 - checks signature, lane sequence, and prefund - - handleOps calls - execute(target, value, data) - - - LaneAccount implementation - inherits the reference Simple7702Account - adds one rule: lane 0 is rejected - ADMIN_LANE = max uint192 for ordered admin calls - - runs this code - - - - venue contract - msg.sender = the funded EOA, not a proxy - tx.origin = the gas-paying relayer - +
+
+
+ + + + + + + + + + + + + + + + + + Funded EOA, same address + same native SEI balance + same token balances and venue approvals + same private key signs every UserOperation + EVM nonce: a self-sponsored delegation spends two, + then it is frozen on the submission path + = 1, 0, 10)}> + + code slot (delegation designator) + 0xef0100 || LaneAccount address + + + = 2, 12, 0)}> + + EntryPoint v0.8 singleton + 0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108 + checks signature, lane sequence, and prefund + + = 2, 12, 0, 300)}> + + handleOps calls + execute(target, value, data) + + + = 3, 12, 0, 250)}> + + LaneAccount implementation + inherits the reference Simple7702Account + adds one rule: lane 0 is rejected + ADMIN_LANE = max uint192 for ordered admin calls + + = 3, -12, 0)}> + + runs this code + + + = 4, 0, -10)}> + + + venue contract + + = 4, -10, 0, 350)}> + msg.sender = the funded EOA, not a proxy + tx.origin = the gas-paying relayer + + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
One type-4 transaction writes the designator into the EOA's code slot. The address, balances, and approvals do not move. When the EntryPoint calls the account, the EVM runs LaneAccount's code in the EOA's context, so the venue sees the funded address as msg.sender.
); }; -export const NonceLanePipeline = () => { - const ink = 'currentColor'; - const accent = 'var(--sei-maroon-50)'; - const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; - const box = { fill: ink, fillOpacity: 0.05, stroke: ink, strokeOpacity: 0.35, strokeWidth: 1 }; - const relayers = ['relayer 0', 'relayer 1', 'relayer 2', 'relayer N']; - return ( -
-
- - - - - - - - - holds the funds, signs intents - holds gas only, cannot forge an operation - - - Funded EOA - delegated to LaneAccount - signs one UserOperation per lane - EIP-712 digest, no nonce RPCs - EVM nonce does not move - - - - Bundling queue - in-process FIFO of signed ops - one op per lane per bundle - no ERC-7562 4-op sender cap - bundles ≤ MAX_OPS_PER_BUNDLE - - {relayers.map((r, i) => { - const y = 40 + i * 72; - return ( - - - - {r} - own sequential nonce, 1 tx in flight - - - ); - })} - the sequential constraint moved here, away from the funds - - - EntryPoint v0.8 - handleOps(ops[], relayer) - validates every op, then executes - each one, refunds gas to the relayer - - - - LaneAccount.execute → venue - msg.sender is the funded EOA - +export const NonceLanePipeline = () => { + const ink = 'currentColor'; + const accent = 'var(--sei-maroon-50)'; + const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; + const hairline = 'rgba(128, 128, 128, 0.25)'; + const box = { fill: ink, fillOpacity: 0.05, stroke: ink, strokeOpacity: 0.35, strokeWidth: 1 }; + const relayers = ['relayer 0', 'relayer 1', 'relayer 2', 'relayer N']; + + const steps = [ + { + title: 'Sign one operation per lane', + text: "The funded EOA, delegated to LaneAccount, signs one UserOperation per lane over an EIP-712 digest. The signing path reads no nonces, and the account's EVM nonce does not move." + }, + { + title: 'Queue the signed operations', + text: <>Signed operations go into an in-process FIFO, not a mempool. A bundle takes up to MAX_OPS_PER_BUNDLE operations, never two from the same lane. The ERC-7562 cap of four pending operations per sender does not apply. + }, + { + title: 'Relayers wrap the bundles', + text: <>Each gas-only relayer wraps a bundle in an EntryPoint.handleOps transaction and pays for it. A relayer has its own sequential EVM nonce and keeps one outer transaction in flight. + }, + { + title: 'The EntryPoint validates and executes', + text: <>handleOps validates every operation, executes each one, and refunds gas to the relayer. + }, + { + title: 'The venue sees the funded EOA', + text: <>Each operation reaches the venue through LaneAccount.execute, with the funded EOA as msg.sender. + }, + { + title: 'The queue moved away from the funds', + text: "The sequential constraint now sits with the relayers, which hold only gas. A relayer key can lose its own gas balance, but it cannot create a valid operation without the funded account's signature." + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const slideIn = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : 'translate(-10px, 0px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + const flow = (at) => (playing && step === at ? 'on' : undefined); + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + + return ( +
+
+
+ + + + + + + + + {relayers.map((r, i) => ( + + ))} + + + + + = 5)}> + + holds the funds, signs intents + holds gas only, cannot forge an operation + + + + Funded EOA + delegated to LaneAccount + signs one UserOperation per lane + EIP-712 digest, no nonce RPCs + EVM nonce does not move + + = 1)}> + + + Bundling queue + in-process FIFO of signed ops + one op per lane per bundle + no ERC-7562 4-op sender cap + bundles ≤ MAX_OPS_PER_BUNDLE + + + {relayers.map((r, i) => { + const y = 40 + i * 72; + return ( + + = 2, i * 180)}> + + + {r} + own sequential nonce, 1 tx in flight + + = 3, i * 120)} data-sei-flow={flow(3)} /> + + ); + })} + = 5 ? accent : ink} fillOpacity={step >= 5 ? 1 : 0.6} fontWeight={step >= 5 ? '600' : '400'} style={shown(step >= 2, 800)}>the sequential constraint moved here, away from the funds + + = 3, 450)}> + + EntryPoint v0.8 + handleOps(ops[], relayer) + validates every op, then executes + each one, refunds gas to the relayer + + + = 4)}> + + + LaneAccount.execute → venue + msg.sender is the funded EOA + + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
UserOperations are not transactions. Gas-only relayers wrap each bundle in an EntryPoint.handleOps transaction and pay for it. Each relayer still has one sequential EVM nonce, but a relayer key can only lose its own gas. It cannot create a valid operation without the funded account's signature.
@@ -713,50 +1254,215 @@ export const NonceLaneBundleLifecycle = () => { export const NonceLaneFailureIsolation = () => { const ink = 'currentColor'; + const accent = 'var(--sei-maroon-50)'; const ok = 'var(--sei-diagram-ok, #1a7a00)'; const bad = 'var(--sei-diagram-error, #c20a00)'; const warn = 'var(--sei-diagram-warning, #b45309)'; - const lane = (x, y, label, sub, c, dashed, key) => ( - - - {label} - {sub} + const hairline = 'rgba(128, 128, 128, 0.25)'; + + const steps = [ + { + title: 'An execution revert stays in its lane', + text: 'The EntryPoint treats an account execution failure as a per-operation result. Lane 30 emits a failed UserOperationEvent and pays gas, all four lane sequences advance, and the bundle continues.' + }, + { + title: 'A validation failure reverts the bundle', + text: 'A bad signature, a stale sequence, or an insufficient prefund fails before anything executes. The whole handleOps transaction reverts, and nothing in it is consumed. Every bundle is simulated before broadcast, so this is normally caught for free.' + }, + { + title: 'A dropped bundle costs nothing', + text: 'A signed operation whose outer transaction was dropped, evicted, or never broadcast leaves its lane sequence untouched. Neighboring lanes stay valid, and the journal requeues the operation.' + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const rise = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : 'translate(0px, 8px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + const lane = (x, y, label, sub, c, dashed, at, delay) => ( + + + = at, delay)}> + + {label} + {sub} + ); + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + return ( -
-
- - Execution revert: isolated to its lane - - one handleOps transaction, one block - {lane(46, 70, 'lane 29', 'filled', ok, false, 'a29')} - {lane(142, 70, 'lane 30', 'reverted', bad, false, 'a30')} - {lane(238, 70, 'lane 31', 'filled', ok, false, 'a31')} - {lane(334, 70, 'lane 32', 'filled', ok, false, 'a32')} - all four sequences advance; lane 30 emits a failed UserOperationEvent and pays gas - the EntryPoint treats an account call failure as a per-operation result - and continues with the next operation in the bundle - - - - Validation failure: the whole bundle - - handleOps reverts, nothing in it is consumed - {lane(486, 70, 'lane 29', 'not consumed', ink, true, 'b29')} - {lane(582, 70, 'lane 30', 'AA25 stale seq', bad, false, 'b30')} - {lane(678, 70, 'lane 31', 'not consumed', ink, true, 'b31')} - {lane(774, 70, 'lane 32', 'not consumed', ink, true, 'b32')} - bad signature, stale sequence, or insufficient prefund fails before any execution - every bundle is simulated before broadcast, so this is normally caught - for free; MAX_OPS_PER_BUNDLE sets the size of this failure domain - - - - Never submitted: nothing consumed - a signed operation whose outer transaction was dropped, evicted, or never broadcast - leaves its lane sequence untouched; neighboring lanes stay valid and the journal requeues it - +
+
+
+ + Execution revert: isolated to its lane + + one handleOps transaction, one block + {lane(46, 70, 'lane 29', 'filled', ok, false, 0, 0)} + {lane(142, 70, 'lane 30', 'reverted', bad, false, 0, 0)} + {lane(238, 70, 'lane 31', 'filled', ok, false, 0, 0)} + {lane(334, 70, 'lane 32', 'filled', ok, false, 0, 0)} + all four sequences advance; lane 30 emits a failed UserOperationEvent and pays gas + the EntryPoint treats an account call failure as a per-operation result + and continues with the next operation in the bundle + + + + = 1)}> + Validation failure: the whole bundle + + handleOps reverts, nothing in it is consumed + + {lane(582, 70, 'lane 30', 'AA25 stale seq', bad, false, 1, 150)} + {lane(486, 70, 'lane 29', 'not consumed', ink, true, 1, 550)} + {lane(678, 70, 'lane 31', 'not consumed', ink, true, 1, 650)} + {lane(774, 70, 'lane 32', 'not consumed', ink, true, 1, 750)} + = 1, 900)}> + bad signature, stale sequence, or insufficient prefund fails before any execution + every bundle is simulated before broadcast, so this is normally caught + for free; MAX_OPS_PER_BUNDLE sets the size of this failure domain + + + + + = 2, 150)}> + + Never submitted: nothing consumed + a signed operation whose outer transaction was dropped, evicted, or never broadcast + leaves its lane sequence untouched; neighboring lanes stay valid and the journal requeues it + + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
The three failures have different blast radii. An execution revert costs one lane sequence and nothing else. A validation failure costs the outer transaction attempt but no sequences. A dropped bundle costs nothing on chain, which is exactly the case that strands a sequential account.
@@ -792,8 +1498,37 @@ export const NonceLaneThroughputComparison = () => { const scale = 6.5; // px per landed op/s, 0..80 across 520 px const rowTop = (i) => 62 + i * 40; const plotBottom = rowTop(rows.length) - 6; + const [drawn, setDrawn] = useState(true); + const rootRef = useRef(null); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return undefined; + if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined; + if (node.getBoundingClientRect().top < window.innerHeight) return undefined; + setDrawn(false); + const observer = new IntersectionObserver( + (entries) => { + if (entries[entries.length - 1].intersectionRatio >= 0.3) { + setDrawn(true); + observer.disconnect(); + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const reveal = (delay) => ({ opacity: drawn ? 1 : 0, transition: drawn ? `opacity 350ms ease ${delay}ms` : 'none' }); + const grow = (delay) => ({ + transformBox: 'fill-box', + transformOrigin: 'left center', + transform: `scaleX(${drawn ? 1 : 0})`, + transition: drawn ? `transform 700ms cubic-bezier(0.4, 0, 0.2, 1) ${delay}ms` : 'none' + }); return ( -
+
Landed operations per second, same venue call, Sei Testnet @@ -810,19 +1545,21 @@ export const NonceLaneThroughputComparison = () => { ))} landed operations per second - - block-gas ceiling - ≈ 73 per second + + + block-gas ceiling + ≈ 73 per second + {rows.map((r, i) => { const y = rowTop(i); return ( {r.label} - - {r.chain.toFixed(1)} - - {r.client.toFixed(1)} + + {r.chain.toFixed(1)} + + {r.client.toFixed(1)} ); })} @@ -849,8 +1586,37 @@ export const NonceLaneBlockGasUtilization = () => { const scale = 4.3; // px per percent, 0..100 across 430 px const rowTop = (i) => 62 + i * 40; const plotBottom = rowTop(rows.length) - 6; + const [drawn, setDrawn] = useState(true); + const rootRef = useRef(null); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return undefined; + if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined; + if (node.getBoundingClientRect().top < window.innerHeight) return undefined; + setDrawn(false); + const observer = new IntersectionObserver( + (entries) => { + if (entries[entries.length - 1].intersectionRatio >= 0.3) { + setDrawn(true); + observer.disconnect(); + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const reveal = (delay) => ({ opacity: drawn ? 1 : 0, transition: drawn ? `opacity 350ms ease ${delay}ms` : 'none' }); + const grow = (delay) => ({ + transformBox: 'fill-box', + transformOrigin: 'left center', + transform: `scaleX(${drawn ? 1 : 0})`, + transition: drawn ? `transform 700ms cubic-bezier(0.4, 0, 0.2, 1) ${delay}ms` : 'none' + }); return ( -
+
Block gas used during each run, percent of the 12,500,000 limit @@ -877,11 +1643,13 @@ export const NonceLaneBlockGasUtilization = () => { return ( {r.label} - - {r.avg.toFixed(1)}% - - {r.max.toFixed(1)}% - {r.full} + + {r.avg.toFixed(1)}% + + + {r.max.toFixed(1)}% + + {r.full} ); })} @@ -921,8 +1689,32 @@ export const NonceLaneScalingSeries = () => { } ]; const points = (p, series) => series.map((v, i) => `${p.x0 + i * p.step},${yFor(v)}`).join(' '); + const trace = (p, series) => Math.ceil(series.reduce((sum, v, i) => (i === 0 ? 0 : sum + Math.hypot(p.step, yFor(v) - yFor(series[i - 1]))), 0)); + const [drawn, setDrawn] = useState(true); + const rootRef = useRef(null); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return undefined; + if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined; + if (node.getBoundingClientRect().top < window.innerHeight) return undefined; + setDrawn(false); + const observer = new IntersectionObserver( + (entries) => { + if (entries[entries.length - 1].intersectionRatio >= 0.3) { + setDrawn(true); + observer.disconnect(); + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const reveal = (delay) => ({ opacity: drawn ? 1 : 0, transition: drawn ? `opacity 350ms ease ${delay}ms` : 'none' }); return ( -
+
{panels.map((p) => { @@ -940,18 +1732,20 @@ export const NonceLaneScalingSeries = () => { ))} block-gas ceiling ≈ 73 - - + + {p.cats.map((c, i) => { const x = p.x0 + i * p.step; // Near the axis a label below the dot would land on the category tick, so it moves beside it. const low = yFor(p.client[i]) + 15 > yBottom - 4; return ( - - - {p.chain[i].toFixed(1)} - {p.client[i].toFixed(1)} + + + + {p.chain[i].toFixed(1)} + {p.client[i].toFixed(1)} + {c} ); From fba617ea865cb639042f42bc2939d67f7b16a2c5 Mon Sep 17 00:00:00 2001 From: alexander-sei Date: Fri, 4 Dec 2026 23:26:44 +0100 Subject: [PATCH 4/8] docs(learn): replace the Twin Turbo card diagram with an animated pipeline The consensus page drew its pipeline with two cards and a text arrow. A step player now compares Tendermint's sequential rounds with Sei's early preparation, execution during voting, and commit to SeiDB, using only the claims on the page. The one-confirmation advice no longer calls committed blocks probabilistically final. Co-authored-by: Cursor --- learn/twin-turbo-consensus.mdx | 21 +-- snippets/consensus-diagrams.jsx | 280 ++++++++++++++++++++++++++++++++ 2 files changed, 285 insertions(+), 16 deletions(-) create mode 100644 snippets/consensus-diagrams.jsx diff --git a/learn/twin-turbo-consensus.mdx b/learn/twin-turbo-consensus.mdx index 4bb090d..c7b74cc 100644 --- a/learn/twin-turbo-consensus.mdx +++ b/learn/twin-turbo-consensus.mdx @@ -4,6 +4,9 @@ sidebarTitle: 'Consensus' description: "Explore how Sei's Twin Turbo consensus mechanism achieves higher transaction throughput by separating block building from consensus, with detailed explanations of the protocol's design and benefits." keywords: ['twin turbo consensus', 'high-speed blockchain', 'transaction throughput', 'blockchain performance', 'validator coordination', 'consensus mechanism'] --- + +import { TwinTurboPipeline } from '/snippets/consensus-diagrams.jsx'; + ## Introduction Sei's consensus mechanism, often called Twin Turbo Consensus, is a set of optimizations designed for low block finality times. The target is approximately 400 milliseconds. Sei does not use a new consensus algorithm to reach this finality. Instead, Sei significantly enhances the underlying Tendermint Byzantine Fault Tolerant (BFT) consensus engine and tunes its configuration aggressively. The consensus engine also integrates tightly with Sei's parallel execution layer and the SeiDB storage system. The goal is near-instant transaction confirmation, which supports a new class of high-performance dApps, particularly dApps built for the EVM. @@ -24,21 +27,7 @@ The optimized flow includes these enhancements: - At the same time, the validator takes part in the standard BFT prevote and precommit voting rounds for the proposed block `H`. 4. **Rapid finalization and commit:** Transaction execution overlaps significantly with the consensus voting process. This greatly reduces the time between reaching 2/3+ precommits for block `H` and having the resulting state changes ready to commit. When consensus is reached, the validated state changes that were buffered during parallel execution are committed efficiently to the underlying SeiDB storage layer. This commit uses the high I/O capabilities of SeiDB. -**Optimized & pipelined consensus** - - - - - Transaction collection & analysis - - State prefetching (SeiDB) - - - - Block proposal reception & initial validation - - BFT voting (prevote/precommit) - - Parallel TX execution (optimistic) - - - -_(Consensus reached)_ → **Finalize state & commit to SeiDB** + This diagram shows the conceptual overlap. Transaction preparation feeds into a process where BFT voting happens _alongside_ parallel transaction execution. The preceding concurrent work lets the final commit to SeiDB happen quickly after consensus. @@ -57,7 +46,7 @@ Sei keeps core EVM compatibility alongside these performance gains. This include The rapid block times enable and encourage these development patterns: -**1. Minimal confirmation waits:** Off-chain applications and scripts should rely on one block confirmation (`txResponse.wait(1)`) for probabilistic finality. This significantly speeds up application logic that depends on transaction inclusion. +**1. Minimal confirmation waits:** Off-chain applications and scripts should rely on one block confirmation (`txResponse.wait(1)`), because a committed block is final. This significantly speeds up application logic that depends on transaction inclusion. ```javascript // Fast transaction submission leveraging ~400ms finality diff --git a/snippets/consensus-diagrams.jsx b/snippets/consensus-diagrams.jsx new file mode 100644 index 0000000..76271a5 --- /dev/null +++ b/snippets/consensus-diagrams.jsx @@ -0,0 +1,280 @@ +// TwinTurboPipeline — a steppable, animated comparison of classic Tendermint, +// which runs propose, prevote, precommit, and commit one after another, with +// Sei's pipeline, where transaction preparation runs before the proposal and +// parallel execution overlaps the voting rounds. It uses the same player as +// the Giga diagrams: it starts when it scrolls into view, loops until a reader +// pauses it, pauses while off screen, and does not autoplay under +// prefers-reduced-motion. +// +// Mintlify evaluates each export in isolation, and module-level declarations +// crash, so every constant lives inside the component. +// +// Usage in MDX: +// import { TwinTurboPipeline } from '/snippets/consensus-diagrams.jsx'; +// +export const TwinTurboPipeline = () => { + const ink = 'currentColor'; + const accent = 'var(--sei-maroon-50)'; + const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; + const hairline = 'rgba(128, 128, 128, 0.25)'; + const rounds = [ + { label: 'propose H', x: 250 }, + { label: 'prevote', x: 368 }, + { label: 'precommit', x: 486 }, + { label: 'commit', x: 604 } + ]; + const roundW = 110; + const topY = 44; + const seiY = 140; + + const steps = [ + { + title: 'Tendermint goes round by round', + text: 'Traditional Tendermint moves through propose, prevote, precommit, and commit somewhat sequentially for each block height.' + }, + { + title: 'Prepare before the proposal', + text: 'Even before the proposal for height H formally begins, validators can start processing its transactions. They collect them, decode them concurrently, estimate their writesets, and can prefetch the state they need from SeiDB.' + }, + { + title: 'The proposal for H arrives', + text: "When a validator receives the proposal for height H, it can start execution before the prevote and precommit rounds complete. It dispatches the block's transactions to the parallel execution engine." + }, + { + title: 'Execute while voting', + text: <>Transactions execute optimistically and concurrently on worker goroutines, and CacheMultiStore buffers their state changes. At the same time, the validator takes part in the prevote and precommit rounds for H. + }, + { + title: 'Ready at 2/3+ precommits', + text: 'Execution overlaps the voting, so little time passes between reaching 2/3+ precommits for H and having its state changes ready to commit.' + }, + { + title: 'Commit to SeiDB', + text: 'Once consensus is reached, the buffered state changes commit to SeiDB. The block is final as soon as it commits, with a target of about 400 ms.' + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const slideIn = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : 'translate(-10px, 0px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + const grow = (on, delay) => ({ + transformBox: 'fill-box', + transformOrigin: 'left center', + transform: `scaleX(${on ? 1 : 0})`, + transition: reduced ? 'none' : on ? `transform 1400ms ${ease} ${delay || 0}ms` : 'transform 250ms ease' + }); + const flow = (at) => (playing && step === at ? 'on' : undefined); + const roundAt = (i) => (i === 0 ? 2 : i < 3 ? 3 : 5); + const roundDelay = (i) => (i === 2 ? 650 : 0); + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + + return ( +
+
+
+ + + + + + + + + + + Traditional Tendermint: one round after another + {rounds.map((r, i) => ( + + {i > 0 ? : null} + + {r.label} + + ))} + height H + + + Sei: preparation and execution overlap the voting + + + {rounds.map((r, i) => ( + + ))} + + + + + + {rounds.map((r, i) => ( + = roundAt(i), roundDelay(i))}> + {i > 0 ? : null} + + {r.label} + + ))} + + = 1)}> + + prepare H before its proposal + collect, decode concurrently, + estimate writesets, can prefetch state + + = 1, 350)} data-sei-flow={flow(1)} /> + + = 2, 300)} data-sei-flow={flow(2) || flow(3)} /> + = 2, 300)}>dispatch + + = 3, 150)} /> + = 3, 500)}> + parallel execution (OCC) + workers write to CacheMultiStore + + + = 4)}> + + 2/3+ precommits: + state changes already buffered + + + = 5, 300)}> + + + SeiDB + block final + + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
+
+
The overlap, not a timing chart. Sei keeps Tendermint's voting rounds, but it prepares a block's transactions early and executes them while validators vote, so the state is ready to commit when consensus is reached.
+
+ ); +}; From a209ee393e72b0aab49ccf32af280a96a7db6daf Mon Sep 17 00:00:00 2001 From: alexander-sei Date: Fri, 4 Dec 2026 23:48:14 +0100 Subject: [PATCH 5/8] docs(ai): add an animated x402 payment sequence Step through one paid request on Sei Testnet: the 402 response with PAYMENT-REQUIRED, the EIP-3009 authorization, the retry with PAYMENT-SIGNATURE, verification, facilitator settlement, and the held response released with PAYMENT-RESPONSE. Co-authored-by: Cursor --- ai/x402.mdx | 5 + snippets/x402-diagrams.jsx | 258 +++++++++++++++++++++++++++++++++++++ 2 files changed, 263 insertions(+) create mode 100644 snippets/x402-diagrams.jsx diff --git a/ai/x402.mdx b/ai/x402.mdx index 769ba03..bc4ddfd 100644 --- a/ai/x402.mdx +++ b/ai/x402.mdx @@ -4,6 +4,9 @@ sidebarTitle: 'x402 Protocol' description: 'Implement HTTP micropayments on Sei using x402 v2 for API monetization and digital services.' keywords: ['x402', 'x402 v2', 'micropayments', 'HTTP 402', 'API monetization', 'Sei', 'payments', 'USDC', 'web3 payments'] --- + +import { X402PaymentFlow } from '/snippets/x402-diagrams.jsx'; + x402 is an open protocol for HTTP-native payments. It lets clients pay for APIs, data, content, and other web resources through the standard `402 Payment Required` flow. A service can charge for a single request. The buyer does not have to create an account, manage a subscription, or negotiate a separate billing integration. When a client requests a paid resource, the server responds with the price and payment terms. The client signs a payment authorization and retries the same request. The server verifies and settles the payment before it returns the resource. @@ -30,6 +33,8 @@ Three components take part in an x402 payment: - The **resource server** defines the price, validates the payment, and returns the protected resource. - A **facilitator** can verify the authorization, submit the payment onchain, and return the settlement result. You can use a facilitator service, run your own, or settle payments directly. + + The client sends a normal HTTP request to the paid endpoint. diff --git a/snippets/x402-diagrams.jsx b/snippets/x402-diagrams.jsx new file mode 100644 index 0000000..4ee315f --- /dev/null +++ b/snippets/x402-diagrams.jsx @@ -0,0 +1,258 @@ +// X402PaymentFlow — a steppable, animated sequence diagram of one paid x402 v2 +// request on Sei Testnet, from the first 402 response through the signed +// retry, verification, settlement, and the released response. It uses the +// same player as the Giga diagrams: it starts when it scrolls into view, loops +// until a reader pauses it, pauses while off screen, and does not autoplay +// under prefers-reduced-motion. +// +// Mintlify evaluates each export in isolation, and module-level declarations +// crash, so every constant lives inside the component. +// +// Usage in MDX: +// import { X402PaymentFlow } from '/snippets/x402-diagrams.jsx'; +// +export const X402PaymentFlow = () => { + const ink = 'currentColor'; + const accent = 'var(--sei-maroon-50)'; + const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; + const hairline = 'rgba(128, 128, 128, 0.25)'; + const col = { client: 110, server: 370, facilitator: 600, sei: 790 }; + const actors = [ + { key: 'client', label: 'client', sub: 'dApp, agent, or service' }, + { key: 'server', label: 'resource server', sub: 'prices the route' }, + { key: 'facilitator', label: 'facilitator', sub: 'optional', dashed: true }, + { key: 'sei', label: 'Sei Testnet', sub: 'eip155:1328' } + ]; + + const steps = [ + { + title: 'Request the resource', + text: <>The client sends a normal HTTP request to the paid endpoint. In this example, that is GET /weather on Sei Testnet. + }, + { + title: 'Receive the payment requirements', + text: <>The server returns 402 Payment Required. Its PAYMENT-REQUIRED header lists the accepted scheme, amount, asset, network, recipient, and resource. Here, that is 0.001 USDC on eip155:1328. + }, + { + title: 'Sign a transfer authorization', + text: 'The client picks an accepted option and signs the payload with its wallet. Native USDC on Sei supports EIP-3009, so with the exact scheme the client signs a transfer authorization instead of sending a transaction.' + }, + { + title: 'Retry with the signature', + text: <>The client sends the same request again with the signed payload in the PAYMENT-SIGNATURE header. The x402 Fetch and Axios adapters automate this retry. + }, + { + title: 'Verify the payload', + text: 'The resource server verifies the payload against its payment requirements, here through a facilitator. Your route handler runs after verification, and the middleware holds its response.' + }, + { + title: 'Settle on Sei', + text: <>The facilitator submits the authorized transfer of Sei Testnet USDC (0x4fCF1784B31630811181f670Aea7A7bEF803eaED) and pays the gas. It waits for the settlement result and returns it to the server. You can also run your own facilitator or settle directly. + }, + { + title: 'Return the resource', + text: <>The middleware sends the held response only after settlement succeeds. The PAYMENT-RESPONSE header carries the settlement details. + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const slideIn = (visible, dx, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : `translate(${dx}px, 0px)`, + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + const message = (at, y, from, to, label, sub, tone, dashed, delay) => { + const x1 = col[from]; + const x2 = col[to]; + const dir = x2 > x1 ? 1 : -1; + const color = tone === 'accent' ? accent : tone === 'gold' ? gold : ink; + const marker = tone === 'accent' ? 'url(#x4-b)' : tone === 'gold' ? 'url(#x4-g)' : 'url(#x4-a)'; + return ( + = at, -12 * dir, delay)}> + + {label} + {sub ? {sub} : null} + + ); + }; + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + + return ( +
+
+
+ + + + + + + + + + + + + + {actors.map((a) => ( + + + + {a.label} + {a.sub} + + ))} + + {message(0, 84, 'client', 'server', 'GET /weather', null, null, false, 0)} + {message(1, 120, 'server', 'client', '402 Payment Required', 'PAYMENT-REQUIRED: 0.001 USDC, eip155:1328', 'accent', false, 0)} + + = 2, 0, 0)}> + + signs an EIP-3009 transfer authorization + no transaction is sent + + + {message(3, 196, 'client', 'server', 'GET /weather, again', 'PAYMENT-SIGNATURE: signed payload', 'accent', false, 0)} + {message(4, 232, 'server', 'facilitator', 'verify the payload', null, null, false, 0)} + {message(4, 246, 'facilitator', 'server', '', 'valid', null, true, 350)} + + = 4, 0, 650)}> + + route handler runs, response held + + + {message(5, 306, 'facilitator', 'sei', 'submit the transfer, pay gas', null, 'gold', false, 0)} + {message(5, 320, 'sei', 'server', '', 'settled: result returned to the server', null, true, 400)} + {message(6, 352, 'server', 'client', 'the held response', 'PAYMENT-RESPONSE: settlement details', 'accent', false, 0)} + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
+
+
One paid request with the exact scheme, following the Express example on this page. The facilitator is optional: a resource server can also run its own or settle payments directly.
+
+ ); +}; From 3269eb2d87da3b7b3032ebc1ac95a1d2de37b63f Mon Sep 17 00:00:00 2001 From: alexander-sei Date: Fri, 4 Dec 2026 23:48:14 +0100 Subject: [PATCH 6/8] docs(node): add an animated state sync walkthrough Show how a new node picks a trusted block, configures state sync, finds a snapshot, verifies forward from the trust height, restores the snapshot, and block syncs to the tip with history that starts at the snapshot. Co-authored-by: Cursor --- node/statesync.mdx | 5 + snippets/statesync-diagrams.jsx | 284 ++++++++++++++++++++++++++++++++ 2 files changed, 289 insertions(+) create mode 100644 snippets/statesync-diagrams.jsx diff --git a/node/statesync.mdx b/node/statesync.mdx index ec2d1d1..24abdd5 100644 --- a/node/statesync.mdx +++ b/node/statesync.mdx @@ -4,12 +4,17 @@ sidebarTitle: 'Statesync' description: 'Detailed guide for using statesync to join the network' keywords: ['sei node', 'blockchain node', 'node configuration', 'seidb', 'node maintenance', 'system operations'] --- + +import { StateSyncFlow } from '/snippets/statesync-diagrams.jsx'; + Use state sync to start a new full node and join an existing network quickly. ## State sync State sync lets a new node join a network without fetching and replaying all historical blocks. Instead, the node fetches a snapshot of the application state at a recent height. This can reduce the time to sync with the network from days to minutes. + + Set `ss-backend = "pebbledb"` before you start state sync. This is especially important if you rebuild a node that previously used RocksDB. RocksDB support for the SeiDB state store will be removed, and there is no published target release for the removal. For the full migration checklist, see [Move off RocksDB](/node/node-operators#move-off-rocksdb). Do not use state sync to migrate an archive node. State sync starts from a recent height and does not preserve the earlier state-store versions. Follow the archive-node guidance in [Move off RocksDB](/node/node-operators#move-off-rocksdb). diff --git a/snippets/statesync-diagrams.jsx b/snippets/statesync-diagrams.jsx new file mode 100644 index 0000000..99c599c --- /dev/null +++ b/snippets/statesync-diagrams.jsx @@ -0,0 +1,284 @@ +// StateSyncFlow — a steppable, animated walk through state sync on a new node: +// pick a trusted block, configure the node, find a snapshot, verify forward +// from the trust height, restore the snapshot, and block sync to the tip. It +// uses the same player as the Giga diagrams: it starts when it scrolls into +// view, loops until a reader pauses it, pauses while off screen, and does not +// autoplay under prefers-reduced-motion. +// +// Mintlify evaluates each export in isolation, and module-level declarations +// crash, so every constant lives inside the component. +// +// Usage in MDX: +// import { StateSyncFlow } from '/snippets/statesync-diagrams.jsx'; +// +export const StateSyncFlow = () => { + const ink = 'currentColor'; + const accent = 'var(--sei-maroon-50)'; + const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; + const ok = 'var(--sei-diagram-ok, #1a7a00)'; + const hairline = 'rgba(128, 128, 128, 0.25)'; + const axisY = 214; + const at = { genesis: 46, trust: 470, snapshot: 640, tip: 820 }; + + const steps = [ + { + title: 'Start from an empty node', + text: 'State sync lets a new node join without fetching and replaying every historical block. It is not attempted if the node already has local state.' + }, + { + title: 'Pick a trusted block', + text: "The script reads the latest height from an RPC endpoint, rounds it down to the nearest 100,000, and fetches that block's hash. The block must fall within the 112h trust period built into seid for Sei Mainnet and Sei Testnet." + }, + { + title: 'Configure state sync', + text: <>The script enables [statesync] in config.toml and sets rpc-servers, trust-height, and trust-hash. rpc-servers needs at least two entries. Set ss-backend = "pebbledb" in app.toml before you start. + }, + { + title: 'Find a snapshot', + text: 'The node discovers peers that take and serve state snapshots. Each snapshot is taken at a specific block height.' + }, + { + title: 'Verify forward', + text: 'A light client verifies the state, over RPC by default. The trust height is meant to sit below the snapshot height, so verification runs forward and avoids backward verification.' + }, + { + title: 'Restore the snapshot', + text: 'The node fetches the snapshot from peers and restores the application state at the snapshot height. This can cut the time to sync from days to minutes.' + }, + { + title: 'Catch up from the snapshot', + text: 'Block sync takes the node from the snapshot height to the tip. Its block history starts at the snapshot height, which is why state sync is not for archive nodes.' + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const paint = reduced ? 'none' : 'stroke 400ms ease, stroke-opacity 400ms ease'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const slideIn = (visible, dx, dy, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : `translate(${dx}px, ${dy}px)`, + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + const grow = (on, delay) => ({ + transformBox: 'fill-box', + transformOrigin: 'left center', + transform: `scaleX(${on ? 1 : 0})`, + transition: reduced ? 'none' : on ? `transform 900ms ${ease} ${delay || 0}ms` : 'transform 250ms ease' + }); + const flow = (k) => (playing && step === k ? 'on' : undefined); + const status = step >= 6 ? 'in sync with the chain' : step >= 5 ? 'state restored at the snapshot height' : step >= 2 ? 'state sync enabled' : 'no local state'; + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + + return ( +
+
+
+ + + + + + + + + + + + + + = 6 ? ok : ink} fillOpacity={step >= 6 ? 0.1 : 0.05} stroke={step >= 6 ? ok : accent} strokeOpacity={step >= 6 ? 1 : 0.9} strokeWidth="1.3" style={{ transition: reduced ? 'none' : 'fill 400ms ease, stroke 400ms ease, fill-opacity 400ms ease' }} /> + new node + {status} + + + state sync peers + take and serve snapshots + + + RPC servers + light client verification + + + = 2, 0, -8)}> + + [statesync] enable = true + rpc-servers, trust-height, trust-hash + [state-store] ss-backend = "pebbledb" + + + + block height + + genesis + + chain tip + + = 1, 350)}> + + trust height + hash + a multiple of 100,000 + + = 1)}> + + round the latest height down, + fetch that block's hash + + + = 3, 350)}> + + snapshot height + + = 3)}> + + snapshot at a recent height + + + = 4, -10, 0)}> + + verify forward + + + = 5, 12, 0)}> + + fetch and restore the snapshot + + + = 6)}> + + history this node never replays + + = 6, 200)} /> + = 6, 700)}>block sync to the tip; history starts at the snapshot + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
+
+
Heights are schematic. The script on this page picks the trust height, and the snapshot height depends on which snapshots your peers serve.
+
+ ); +}; From 2dd0d567034c2bf6d19a4450c3da808bc512f4ea Mon Sep 17 00:00:00 2001 From: alexander-sei Date: Fri, 4 Dec 2026 23:48:14 +0100 Subject: [PATCH 7/8] docs(evm): add animated block tag and pending state comparisons The finality page shows latest, safe, and finalized pointing to different Ethereum blocks and to one Sei block. The differences page shows why executing before broadcasting creates a pending window that Sei does not have, and its text now says the block, not the node, is accepted. Co-authored-by: Cursor --- evm/differences-with-ethereum.mdx | 5 +- evm/evm-parity/finality.mdx | 4 + snippets/finality-diagrams.jsx | 507 ++++++++++++++++++++++++++++++ 3 files changed, 515 insertions(+), 1 deletion(-) create mode 100644 snippets/finality-diagrams.jsx diff --git a/evm/differences-with-ethereum.mdx b/evm/differences-with-ethereum.mdx index f3ca9c9..a452f06 100644 --- a/evm/differences-with-ethereum.mdx +++ b/evm/differences-with-ethereum.mdx @@ -6,6 +6,7 @@ keywords: ['Sei EVM', 'Ethereum comparison', 'blockchain differences', 'EVM comp --- import { SstoreGasLive } from '/snippets/sstore-gas-live.jsx'; +import { PendingStateComparison } from '/snippets/finality-diagrams.jsx'; Sei has full EVM compatibility, but Sei EVM and Ethereum differ in some ways: @@ -183,13 +184,15 @@ committed (approximately 400 ms). This means that Ethereum's commitment levels On Ethereum, the block proposer executes its proposed block first and updates its local state. Then it broadcasts the proposal to others. The updated state -is marked "pending" until the node is accepted by other nodes. +is marked "pending" until the block is accepted by other nodes. However, on Sei, the block proposer broadcasts the proposal first. It executes the proposal only if the proposal is accepted. This means that every node executes the block at roughly the same time, so Sei does not have a window when a "pending state" exists. + + ## Gas model & fees Sei does not burn the base fee. All transaction fees go to validators. Fees are calculated as: diff --git a/evm/evm-parity/finality.mdx b/evm/evm-parity/finality.mdx index 5d60539..e291cc0 100644 --- a/evm/evm-parity/finality.mdx +++ b/evm/evm-parity/finality.mdx @@ -3,6 +3,8 @@ title: 'Finality and Block Tags' description: 'How Sei instant finality affects block tag behavior and pending state' --- +import { BlockTagsComparison } from '/snippets/finality-diagrams.jsx'; + # Finality and block tags Sei uses Twin Turbo Consensus, which gives instant finality. Every committed block is final immediately. There is no period in which a reorganization could remove it. @@ -19,6 +21,8 @@ On Ethereum, `latest`, `safe`, and `finalized` refer to different points in the On Sei, all three tags resolve to the same block. After a block is committed, there is no reorg risk at any point, so the distinction does not exist. + + ```ts viem diff --git a/snippets/finality-diagrams.jsx b/snippets/finality-diagrams.jsx new file mode 100644 index 0000000..6226c26 --- /dev/null +++ b/snippets/finality-diagrams.jsx @@ -0,0 +1,507 @@ +// Ethereum-versus-Sei finality diagrams. Both use the same player as the Giga +// diagrams: they start when they scroll into view, loop until a reader pauses +// them, pause while off screen, and do not autoplay under +// prefers-reduced-motion. +// +// - BlockTagsComparison: where latest, safe, and finalized point on Ethereum, +// and how all three resolve to the same block on Sei. +// - PendingStateComparison: Ethereum's proposer executes before it +// broadcasts, so its state is pending until the block is accepted. Sei's +// proposer broadcasts first, and every node executes after acceptance. +// +// Mintlify evaluates each export in isolation, and module-level declarations +// crash, so every constant lives inside its component. +// +// Usage in MDX: +// import { BlockTagsComparison, PendingStateComparison } from '/snippets/finality-diagrams.jsx'; +// +export const BlockTagsComparison = () => { + const ink = 'currentColor'; + const accent = 'var(--sei-maroon-50)'; + const ok = 'var(--sei-diagram-ok, #1a7a00)'; + const hairline = 'rgba(128, 128, 128, 0.25)'; + const ethBlocks = [150, 210, 310, 370, 430, 530, 590, 650]; + const ethLinks = [[150, 210], [310, 370], [370, 430], [530, 590], [590, 650]]; + const seiBlocks = [150, 210, 270, 330, 390, 450]; + const blockW = 50; + const ethY = 70; + const seiY = 200; + const ethTags = [ + { label: 'latest', x: 650, at: 0 }, + { label: 'safe', x: 430, at: 1 }, + { label: 'finalized', x: 210, at: 2 } + ]; + const seiTags = [ + { label: 'latest', cx: 385 }, + { label: 'safe', cx: 475 }, + { label: 'finalized', cx: 565 } + ]; + + const steps = [ + { + title: 'Ethereum: latest is the tip', + text: <>On Ethereum, latest is the most recent block, and it may not be safe yet. + }, + { + title: 'safe trails latest', + text: <>safe points to an earlier block that is unlikely to be reorganized. + }, + { + title: 'finalized trails further', + text: <>finalized points to a block that is permanently committed. Waiting for the finalized tag takes about 13 minutes. + }, + { + title: 'Sei: one block for all three', + text: <>Every committed block on Sei is final immediately, so latest, safe, and finalized all resolve to the same block. + }, + { + title: 'One confirmation is enough', + text: <>waitForTransactionReceipt resolves as soon as the transaction is included in a block, and that receipt is already final. One confirmation is sufficient. + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const ghost = (pending) => ({ opacity: pending ? 1 : 0, transition: reduced ? 'none' : 'opacity 300ms ease' }); + const drop = (visible, delay) => ({ + opacity: visible ? 1 : 0, + transform: visible ? 'translate(0px, 0px)' : 'translate(0px, -10px)', + transition: reduced ? 'none' : `transform 500ms ${ease} ${visible ? delay || 0 : 0}ms, opacity 350ms ease ${visible ? delay || 0 : 0}ms` + }); + const pill = (label, cx, y, color) => ( + + + {label} + + ); + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + + return ( +
+
+
+ + + + + + + + + + + + + + Ethereum + {ethLinks.map(([a, b]) => ( + + ))} + ⋯ + ⋯ + {ethBlocks.map((x) => ( + + ))} + newest + {ethTags.map((t) => ( + = t.at, 150)}> + {pill(t.label, t.x + blockW / 2, 34, t.label === 'finalized' ? ok : accent)} + + + ))} + = 2, 500)}> + + waiting for finalized takes about 13 minutes + + + + + Sei + + {seiBlocks.map((x) => ( + + ))} + + = 3)}> + {seiBlocks.slice(1).map((x, i) => ( + + ))} + {seiBlocks.map((x, i) => ( + + ))} + committed, so final + + {seiTags.map((t, i) => ( + = 3, 350 + i * 150)}> + {pill(t.label, t.cx, 166, ok)} + + + ))} + + = 4, 200)}> + + + receipt + final at 1 confirmation + + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
+
+
The gaps in the Ethereum chain stand for blocks left out. On Ethereum the tags point to different blocks. On Sei, a committed block has no reorg risk, so the distinction does not exist.
+
+ ); +}; + +export const PendingStateComparison = () => { + const ink = 'currentColor'; + const accent = 'var(--sei-maroon-50)'; + const gold = 'var(--sei-diagram-gold, var(--sei-gold-100))'; + const ok = 'var(--sei-diagram-ok, #1a7a00)'; + const hairline = 'rgba(128, 128, 128, 0.25)'; + const ethTop = 44; + const seiTop = 168; + + const steps = [ + { + title: 'Ethereum: execute first', + text: 'On Ethereum, the block proposer executes its proposed block first and updates its local state.' + }, + { + title: 'Broadcast while state is pending', + text: 'The proposer then broadcasts the proposal. Its updated state is marked pending until the other nodes accept the block.' + }, + { + title: 'Sei: broadcast first', + text: 'On Sei, the block proposer broadcasts the proposal first, before it executes anything.' + }, + { + title: 'Execute after acceptance', + text: 'The proposer executes the proposal only if the proposal is accepted. Every node then executes the block at roughly the same time.' + }, + { + title: 'No pending window', + text: 'No node runs ahead of the others, so Sei has no window in which a pending state exists. Read committed blocks instead of pending state.' + } + ]; + const last = steps.length - 1; + + const [step, setStep] = useState(0); + const [playing, setPlaying] = useState(false); + const [reduced, setReduced] = useState(false); + const rootRef = useRef(null); + const playingRef = useRef(false); + const auto = useRef({ armed: true, resume: false }); + playingRef.current = playing; + + useEffect(() => { + if (typeof window === 'undefined' || !window.matchMedia) return undefined; + const query = window.matchMedia('(prefers-reduced-motion: reduce)'); + const update = () => setReduced(query.matches); + update(); + if (!query.addEventListener) return undefined; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); + }, []); + + useEffect(() => { + if (!playing) return undefined; + const timer = setTimeout(() => setStep(step >= last ? 0 : step + 1), step >= last ? 3000 : step === 0 ? 800 : 2000); + return () => clearTimeout(timer); + }, [playing, step]); + + useEffect(() => { + const node = rootRef.current; + if (!node || typeof IntersectionObserver === 'undefined') return undefined; + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[entries.length - 1]; + if (entry.intersectionRatio >= 0.3) { + const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if ((auto.current.armed && !reduceMotion) || auto.current.resume) setPlaying(true); + auto.current = { armed: false, resume: false }; + } else if (!entry.isIntersecting && playingRef.current) { + setPlaying(false); + auto.current = { armed: false, resume: true }; + } + }, + { threshold: [0, 0.35] } + ); + observer.observe(node); + return () => observer.disconnect(); + }, []); + + const go = (next) => { + auto.current = { armed: false, resume: false }; + setPlaying(false); + setStep(Math.max(0, Math.min(last, next))); + }; + const togglePlay = () => { + auto.current = { armed: false, resume: false }; + if (playing) { + setPlaying(false); + return; + } + setStep(step >= last ? 0 : step + 1); + setPlaying(true); + }; + + const ease = 'cubic-bezier(0.4, 0, 0.2, 1)'; + const shown = (visible, delay) => ({ opacity: visible ? 1 : 0, transition: reduced ? 'none' : `opacity 400ms ease ${visible ? delay || 0 : 0}ms` }); + const grow = (on, delay) => ({ + transformBox: 'fill-box', + transformOrigin: 'left center', + transform: `scaleX(${on ? 1 : 0})`, + transition: reduced ? 'none' : on ? `transform 600ms ${ease} ${delay || 0}ms` : 'transform 250ms ease' + }); + const label = (on, delay) => ({ opacity: on ? 1 : 0, transition: reduced ? 'none' : on ? `opacity 300ms ease ${(delay || 0) + 300}ms` : 'opacity 200ms ease' }); + const bar = (key, x, w, y, text, color, on, delay) => ( + + + + {text} + + ); + + const primaryButton = { + backgroundColor: 'var(--sei-maroon-100)', + color: '#ffffff', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 14px', + borderRadius: '6px', + minWidth: '76px', + cursor: 'pointer' + }; + const secondaryButton = (disabled) => ({ + backgroundColor: 'rgba(128, 128, 128, 0.14)', + fontFamily: 'var(--sei-font-mono)', + fontSize: '11px', + letterSpacing: '0.04em', + textTransform: 'uppercase', + padding: '6px 12px', + borderRadius: '6px', + opacity: disabled ? 0.4 : 1, + cursor: disabled ? 'default' : 'pointer' + }); + + return ( +
+
+
+ + + + + + + + Ethereum: execute, then broadcast + proposer + other nodes + {bar('e-exec', 130, 140, ethTop, 'execute block', gold, true, 0)} + {bar('e-bcast', 280, 120, ethTop, 'broadcast', ink, step >= 1, 0)} + {bar('e-recv', 410, 130, ethTop + 40, 'receive proposal', ink, step >= 1, 450)} + {bar('e-accept', 550, 120, ethTop + 40, 'accept block', ink, step >= 1, 900)} + = 1, 450)} data-sei-flow={playing && step === 1 ? 'on' : undefined} /> + = 1, 1300)}> + + proposer's state is pending + + + + + + Sei: broadcast, then execute + proposer + other nodes + {bar('s-bcast', 130, 140, seiTop, 'broadcast proposal', ink, step >= 2, 0)} + {bar('s-recv', 280, 130, seiTop + 40, 'receive proposal', ink, step >= 2, 450)} + {bar('s-accept', 420, 130, seiTop + 40, 'accept block', ink, step >= 3, 0)} + {bar('s-exec-p', 560, 140, seiTop, 'execute block', gold, step >= 3, 550)} + {bar('s-exec-n', 560, 140, seiTop + 40, 'execute block', gold, step >= 3, 550)} + = 2, 450)} data-sei-flow={playing && step === 2 ? 'on' : undefined} /> + = 3, 350)}> + + accepted + + = 4)}> + + no pending window: + every node executes + at roughly the same time + + +
+ +
+
+
+ Step {step + 1} of {steps.length} +
+
{steps[step].title}
+

{steps[step].text}

+
+
+ + + +
+
+ +
+ {steps.map((item, i) => ( +
+
+
The order of execution and broadcast is what creates or removes a pending window. Ethereum's proposer runs ahead of the network. Sei's nodes execute together after acceptance, so there is no pending state to read.
+
+ ); +}; From 6f0adb20c01fad2aceabfcb8438e27d8440e3703 Mon Sep 17 00:00:00 2001 From: alexander-sei Date: Fri, 4 Dec 2026 23:54:50 +0100 Subject: [PATCH 8/8] docs(ai): drop the remaining TEE-only labels from the agentic wallet diagram The step title, the stage node, the aria-label, and the lock label still said a TEE always signs. They now name a generic signer, and the step text keeps the managed-versus-self-custodial detail. Co-authored-by: Cursor --- snippets/agentic-wallet-diagrams.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snippets/agentic-wallet-diagrams.jsx b/snippets/agentic-wallet-diagrams.jsx index fa87801..3adec29 100644 --- a/snippets/agentic-wallet-diagrams.jsx +++ b/snippets/agentic-wallet-diagrams.jsx @@ -33,7 +33,7 @@ export const AgenticWalletFlow = () => { text: 'Spending limits, address allowlists, and other guardrails run before anything is signed.' }, { - title: 'The TEE signs', + title: 'The signer signs', text: <>In a managed wallet such as Privy, the private key stays inside a Trusted Execution Environment (TEE), and the signer hands back only the signed transaction. With a self-custodial ViemWalletProvider, you hold the key yourself and there is no TEE. }, { @@ -51,7 +51,7 @@ export const AgenticWalletFlow = () => { { label: 'LLM / agent', sub: 'decides what to do' }, { label: 'Wallet SDK', sub: 'builds the transaction' }, { label: 'Policy engine', sub: 'checks the rules' }, - { label: 'TEE signer', sub: 'holds the key' }, + { label: 'Signer', sub: 'holds the key' }, { label: 'Sei EVM RPC', sub: 'broadcasts it' } ]; const stageX = (i) => 30 + i * 172; @@ -164,7 +164,7 @@ export const AgenticWalletFlow = () => {
- + @@ -205,11 +205,11 @@ export const AgenticWalletFlow = () => { = 3 && !rejected, 200)}> - + - key stays inside + key stays with the signer ✓ submitted