fallow_extract/cache/types.rs
1//! Serialization types for the incremental parse cache.
2//!
3//! All types use bitcode `Encode`/`Decode` for fast binary serialization.
4
5use bitcode::{Decode, Encode};
6
7use crate::MemberKind;
8
9/// Cache version, bump when the cache format or cached extraction semantics change.
10///
11/// Bumped to 89 for issue #475: extraction now strips a leading UTF-8 BOM
12/// before hashing and computing line offsets, so pre-fix entries whose source
13/// included a BOM carry hashes over the wrong byte sequence and would
14/// fast-path into stale `member_accesses` / `exports` for any BOM-bearing
15/// file. The bump invalidates user caches once on upgrade; subsequent runs
16/// are warm.
17///
18/// Bumped to 90 for issue #540: CSS Modules class extraction now strips
19/// `@layer` and `@import` at-rule preludes before scanning class names, so
20/// pre-fix entries for `.module.css` files using nested cascade-layer syntax
21/// (`@layer foo.bar { ... }`) carry phantom `bar` / `baz` exports that the
22/// new scanner no longer produces.
23///
24/// Bumped to 91 for issue #549: CSS Modules class extraction now records a
25/// real `Span` pointing at each class's declaration position in the source.
26/// Pre-fix cache entries for `.module.css` / `.module.scss` files carry
27/// `Span::default()` (start=0, end=0) on every export, which renders every
28/// finding at line:1 col:0; the new scanner produces real offsets.
29///
30/// Bumped to 92 for issue #563: feature flag extraction recognizes additional
31/// built-in SDK providers (PostHog, Vercel Flags, Optimizely, Eppo, plus more
32/// ConfigCat surfaces) and Vercel `flag({ key: "..." })` object arguments, so
33/// pre-fix entries can carry stale `flag_uses`.
34///
35/// Bumped to 93 for issue #589: Node `module.register()` loader calls now
36/// emit `DynamicImportInfo.destructured_names` populated with the loader-hook
37/// allowlist (current `initialize` / `resolve` / `load` / `globalPreload`
38/// plus legacy `getFormat` / `getSource` / `transformSource`) for every
39/// relative or `file:` specifier, including specifiers bound via
40/// `new URL(..., import.meta.url)`. Pre-fix entries carry empty
41/// `destructured_names` for the same source, so they would silently miss
42/// the named-export credit until the file is touched.
43///
44/// Bumped to 94 for issue #586: Playwright helper fixture extraction recognizes
45/// helpers with local setup before the final `return base.extend<T>(...)`, so
46/// pre-fix entries can miss fixture definition sentinels.
47///
48/// Bumped to 95 for the Glimmer `<template>` scanner: imported-binding usage
49/// and `MemberAccess { object: "this", member }` records for `{{this.foo}}`
50/// template references are now folded into the extractor before
51/// `into_module_info`. Pre-fix entries for `.gts` / `.gjs` files omit both,
52/// so template-only imports surface as `unused-import` and template-only
53/// class members as `unused-class-member` until the cache is re-extracted.
54///
55/// Bumped to 96 for issue #640: generic JSX `<script src>` and
56/// `<link rel="stylesheet|modulepreload" href>` attributes no longer emit
57/// synthetic `SideEffect` imports, so pre-fix entries can carry stale JSX
58/// resource edges that surface as false `unresolved-imports`.
59///
60/// Bumped to 97 for issue #639: MDX import/export extraction now skips
61/// fenced Markdown code blocks, so pre-fix entries can carry stale example
62/// imports that surface as false `unresolved-imports`.
63///
64/// Bumped to 98 for issue #638: statically resolvable `child_process.fork()`
65/// targets now emit `DynamicImportInfo` entries for local runner files.
66/// Pre-fix entries omit those dynamic imports, so forked script files can be
67/// reported as unused until the file is re-extracted.
68///
69/// Bumped to 99 for issue #605: methods reached via `new Class(...).method()`
70/// receivers (direct and fluent-chain) now emit member accesses crediting the
71/// constructed class. Pre-fix entries lack those accesses, so such methods can
72/// be reported as unused class members until the file is re-extracted.
73///
74/// Bumped to 100 for issue #608: static Iconify icon strings (`icon="jam:github"`,
75/// `name="ic:round-home"`) in markup now populate `iconify_prefixes` so the
76/// `@iconify-json/<prefix>` package is credited. Pre-fix entries omit the field,
77/// so icon-set packages can be reported as unused until the file is re-extracted.
78///
79/// Bumped to 101 for issue #704: SFC template tags that match no import now
80/// populate `auto_import_candidates` for convention auto-import resolution.
81/// Pre-fix entries omit the field, so Nuxt components consumed only via template
82/// tags are not edge-credited until the file is re-extracted.
83///
84/// Bumped to 102 for issue #742: `FunctionComplexity` now carries an
85/// `Option<String> source_hash` (content digest of the function's full-span
86/// source slice) so runtime-coverage baselines survive line moves. Pre-fix
87/// cache entries lack the field, so the hash is absent until re-extraction.
88///
89/// Bumped to 103 for issue #752: typed destructure bindings
90/// (`let { resultState }: Props = $props()`, `function f({ x }: Props)`) now
91/// populate `binding_target_names`, which changes the `member_accesses` emitted
92/// for those files. Pre-fix cache entries lack the additional member accesses.
93///
94/// Bumped to 104 for issue #445: MDX, Astro, Vue/Svelte SFC, and CSS/SCSS
95/// container extraction now remaps source-authored spans back to the original
96/// file byte offsets. Pre-fix entries can carry synthetic extracted-buffer
97/// positions, so diagnostics can point at line 1 or compacted MDX lines until
98/// the file is re-extracted.
99///
100/// Bumped to 105 for issue #739: JS/TS and Vue/Svelte SFC script extraction
101/// now populates `auto_import_candidates` from unresolved value references.
102/// Pre-fix entries omit these candidates, so convention script auto-imports
103/// are not edge-credited until the file is re-extracted.
104///
105/// Bumped to 106 for `fallow security`: JS/TS extraction now stores file-level
106/// directives (`"use client"`, `"use server"`) in the parse cache so client
107/// boundary detection does not depend on stale cached module info.
108///
109/// Bumped to 107 for issue #835: Svelte `<script src>` references no longer
110/// emit synthetic imports because they are runtime markup, not bundled SFC
111/// script modules. Pre-fix entries can carry stale root-relative imports that
112/// surface as false `unresolved-imports`.
113///
114/// Bumped to 108 for three extraction-semantics changes shipping together:
115/// - issue #839: `declare` ambient class properties are no longer extracted as
116/// class members (they emit no JS and cannot be value-referenced), so pre-fix
117/// entries carry phantom members that surface as false `unused-class-member`.
118/// - issue #840: extensionless `new URL(specifier, import.meta.url)` dynamic
119/// imports now persist `is_speculative = true` so a directory target
120/// (`new URL('./services', import.meta.url)`) is silently dropped when the
121/// resolver finds no module; pre-fix entries carry `is_speculative = false`
122/// and surface as false `unresolved-imports`.
123/// - issue #845: a method call on an `instanceof`-narrowed value now emits a
124/// member access against the narrowed class, changing the persisted
125/// `member_accesses`; pre-fix entries miss the credit and surface as false
126/// `unused-class-member`.
127///
128/// Bumped to 109 for the data-driven security matcher catalogue: JS/TS
129/// extraction now captures non-literal sink sites into `security_sinks`, each
130/// carrying an `arg_kind` discriminator (template-with-substitution, concat,
131/// object, call, other) so the catalogue can require unsafe SQL shapes and
132/// exclude safely-parameterized `` sql`${x}` `` templates and object-form
133/// `.execute({ sql, args })` arguments. Pre-109 entries lack the field, so their
134/// sink sites do not feed the catalogue until the file is re-extracted.
135///
136/// Bumped to 110 for issue #844: `const svc = useMemo(() => new Svc())` now
137/// binds the non-destructured identifier to the constructed class, so method
138/// calls on it emit member accesses crediting the class. This changes the
139/// persisted `member_accesses` for files using the useMemo factory shape;
140/// pre-fix entries miss the credit and surface as false `unused-class-member`.
141///
142/// Bumped to 111 for issue #859 (untrusted-source modeling): `SinkSite` now
143/// carries `arg_idents` (identifiers referenced in the sink argument) and
144/// `ModuleInfo`/`CachedModule` carry `tainted_bindings` (local bindings tied to
145/// the member-access path they were sourced from), so the security
146/// `tainted_sink` detector can back-trace a sink argument to a known untrusted
147/// source. Pre-111 entries lack both, so source-to-sink association is unset
148/// until the file is re-extracted.
149///
150/// Bumped to 112 for issue #863 (sanitizer-aware security sinks):
151/// `ModuleInfo`/`CachedModule` now carry direct sanitized sink arguments, so
152/// the security `tainted_sink` detector can suppress high-confidence
153/// DOMPurify-backed HTML sink candidates. Pre-112 entries lack sanitizer
154/// metadata until the file is re-extracted.
155///
156/// Bumped to 113 for issue #863 follow-up: sanitizer metadata gained URL and
157/// path domains plus guarded path backpatching. Pre-113 entries may lack those
158/// sanitizer domains until the file is re-extracted.
159pub(super) const CACHE_VERSION: u32 = 113;
160
161/// Duplication token cache version. Bump when duplicate tokenization,
162/// normalization, or the on-disk token cache schema changes.
163pub const DUPES_CACHE_VERSION: u32 = 4;
164
165/// Default maximum cache size (256 MB). Overridable per-project via
166/// `cache.maxSizeMb` in the config file or `FALLOW_CACHE_MAX_SIZE` env var.
167/// Also used as the hard ceiling on load-time deserialization as a defence
168/// against pathological on-disk files.
169pub const DEFAULT_CACHE_MAX_SIZE: usize = 256 * 1024 * 1024;
170
171/// Trigger LRU eviction when the serialized cache exceeds 80% of the cap.
172/// Basis points (1/100 of a percent) for integer arithmetic without floats.
173pub(super) const EVICTION_TRIGGER_BPS: usize = 8000;
174
175/// Evict down to 60% of the cap so subsequent saves leave headroom.
176pub(super) const EVICTION_TARGET_BPS: usize = 6000;
177
178/// Promote the eviction log from `debug!` to `info!` when at least 25% of
179/// entries are removed in a single save. Default-noise concerns mean
180/// small-turnover saves should not be visible without `RUST_LOG=debug`.
181pub(super) const EVICTION_SIGNIFICANT_BPS: usize = 2500;
182
183/// Import kind discriminant for `CachedImport`:
184/// 0 = Named, 1 = Default, 2 = Namespace, 3 = `SideEffect`.
185pub(super) const IMPORT_KIND_NAMED: u8 = 0;
186pub(super) const IMPORT_KIND_DEFAULT: u8 = 1;
187pub(super) const IMPORT_KIND_NAMESPACE: u8 = 2;
188pub(super) const IMPORT_KIND_SIDE_EFFECT: u8 = 3;
189
190macro_rules! assert_cached_type_size {
191 ($ty:ty, $size:expr) => {
192 const _: () = assert!(
193 std::mem::size_of::<$ty>() == $size,
194 concat!(
195 stringify!($ty),
196 " size changed; bump CACHE_VERSION if the cached wire shape or extraction semantics changed, then update this assertion"
197 )
198 );
199 };
200}
201
202assert_cached_type_size!(CachedModule, 664);
203assert_cached_type_size!(CachedNamespaceObjectAlias, 72);
204assert_cached_type_size!(CachedLocalTypeDeclaration, 32);
205assert_cached_type_size!(CachedPublicSignatureTypeReference, 56);
206assert_cached_type_size!(CachedSuppression, 12);
207assert_cached_type_size!(CachedUnknownSuppressionKind, 32);
208assert_cached_type_size!(CachedExport, 112);
209assert_cached_type_size!(CachedImport, 96);
210assert_cached_type_size!(CachedDynamicImport, 88);
211assert_cached_type_size!(CachedRequireCall, 80);
212assert_cached_type_size!(CachedReExport, 88);
213assert_cached_type_size!(CachedMember, 64);
214assert_cached_type_size!(CachedDynamicImportPattern, 56);
215assert_cached_type_size!(crate::MemberAccess, 48);
216assert_cached_type_size!(fallow_types::extract::SinkSite, 64);
217assert_cached_type_size!(fallow_types::extract::FunctionComplexity, 72);
218assert_cached_type_size!(fallow_types::extract::FlagUse, 80);
219assert_cached_type_size!(fallow_types::extract::ClassHeritageInfo, 96);
220
221/// Cached data for a single module.
222#[derive(Debug, Clone, Encode, Decode)]
223pub struct CachedModule {
224 /// xxh3 hash of the file content.
225 pub content_hash: u64,
226 /// File modification time (seconds since epoch) for fast cache validation.
227 /// When mtime+size match the on-disk file, we skip reading file content entirely.
228 pub mtime_secs: u64,
229 /// File size in bytes for fast cache validation.
230 pub file_size: u64,
231 /// Seconds-since-epoch at the time this entry was last WRITTEN
232 /// (first parse or content-change refresh). NOT updated on cache-hit
233 /// reads: `update_cache` already iterates every in-scope file every run,
234 /// so refreshing on read would collapse the LRU to "last run this file
235 /// was discovered" for every retained entry. With write-only refresh,
236 /// the LRU genuinely targets stale (in-scope-but-unchanged-for-many-runs)
237 /// entries. Used by `CacheStore::save` for write-time eviction ordering.
238 pub last_access_secs: u64,
239 /// Exported symbols.
240 pub exports: Vec<CachedExport>,
241 /// Import specifiers.
242 pub imports: Vec<CachedImport>,
243 /// Re-export specifiers.
244 pub re_exports: Vec<CachedReExport>,
245 /// Dynamic import specifiers.
246 pub dynamic_imports: Vec<CachedDynamicImport>,
247 /// `require()` specifiers.
248 pub require_calls: Vec<CachedRequireCall>,
249 /// Static member accesses (e.g., `Status.Active`).
250 pub member_accesses: Vec<crate::MemberAccess>,
251 /// Identifiers used as whole objects (Object.values, for..in, spread, etc.).
252 pub whole_object_uses: Vec<String>,
253 /// Dynamic import patterns with partial static resolution.
254 pub dynamic_import_patterns: Vec<CachedDynamicImportPattern>,
255 /// Whether this module uses CJS exports.
256 pub has_cjs_exports: bool,
257 /// Whether this module declares at least one Angular `@Component({
258 /// templateUrl: ... })` decorator. Mirrors `ModuleInfo.has_angular_component_template_url`
259 /// so the CRAP-inherit walker's gate survives a warm-cache load.
260 pub has_angular_component_template_url: bool,
261 /// Local names of import bindings that are never referenced in this file.
262 pub unused_import_bindings: Vec<String>,
263 /// Local import bindings referenced from type positions.
264 pub type_referenced_import_bindings: Vec<String>,
265 /// Local import bindings referenced from value positions.
266 pub value_referenced_import_bindings: Vec<String>,
267 /// Inline suppression directives.
268 pub suppressions: Vec<CachedSuppression>,
269 /// Suppression tokens that did not parse to any known `IssueKind`. See #449.
270 pub unknown_suppression_kinds: Vec<CachedUnknownSuppressionKind>,
271 /// Pre-computed line-start byte offsets for O(log N) byte-to-line/col conversion.
272 pub line_offsets: Vec<u32>,
273 /// Per-function complexity metrics.
274 pub complexity: Vec<fallow_types::extract::FunctionComplexity>,
275 /// Feature flag use sites.
276 pub flag_uses: Vec<fallow_types::extract::FlagUse>,
277 /// Heritage metadata for exported classes.
278 pub class_heritage: Vec<fallow_types::extract::ClassHeritageInfo>,
279 /// Local type-capable declarations.
280 pub local_type_declarations: Vec<CachedLocalTypeDeclaration>,
281 /// Type references from exported public signatures.
282 pub public_signature_type_references: Vec<CachedPublicSignatureTypeReference>,
283 /// Namespace-import aliases re-exported through an object literal
284 /// (`export const API = { foo }` where `foo` is `import * as foo from './bar'`).
285 pub namespace_object_aliases: Vec<CachedNamespaceObjectAlias>,
286 /// Iconify collection prefixes found in static icon props (issue #608).
287 pub iconify_prefixes: Vec<String>,
288 /// Bare identifier names that are candidates for convention auto-import
289 /// resolution (issue #704). Content-local, so they round-trip through the
290 /// cache; resolution against the plugin table happens at graph-build time.
291 pub auto_import_candidates: Vec<String>,
292 /// File-level string directives (`"use client"`, `"use server"`). Content-local,
293 /// round-trips through the cache so the security `client-server-leak` detector
294 /// sees directives on warm-cache loads.
295 pub directives: Vec<String>,
296 /// Captured non-literal security sink sites (category-blind). Round-trips
297 /// through the cache so the catalogue-driven `tainted_sink` detector sees
298 /// sinks on warm-cache loads.
299 pub security_sinks: Vec<fallow_types::extract::SinkSite>,
300 /// Count of sink-shaped nodes whose callee could not be flattened to a
301 /// static path. Round-trips so the in-band blind-spot count is stable.
302 pub security_sinks_skipped: u32,
303 /// Local bindings tied to the member-access path they were sourced from.
304 /// Round-trips so the security `tainted_sink` source-to-sink association
305 /// sees source-tainted bindings on warm-cache loads.
306 pub tainted_bindings: Vec<fallow_types::extract::TaintedBinding>,
307 /// Direct sink arguments recognized as sanitizer calls.
308 pub sanitized_sink_args: Vec<fallow_types::extract::SanitizedSinkArg>,
309}
310
311/// Cached namespace-object alias.
312#[derive(Debug, Clone, Encode, Decode)]
313pub struct CachedNamespaceObjectAlias {
314 /// Canonical export name on this module.
315 pub via_export_name: String,
316 /// Dotted suffix of the property path relative to the export.
317 pub suffix: String,
318 /// Local name of the namespace import on this module.
319 pub namespace_local: String,
320}
321
322/// Cached local type declaration.
323#[derive(Debug, Clone, Encode, Decode)]
324pub struct CachedLocalTypeDeclaration {
325 /// Local declaration name.
326 pub name: String,
327 /// Byte offset of the declaration span start.
328 pub span_start: u32,
329 /// Byte offset of the declaration span end.
330 pub span_end: u32,
331}
332
333/// Cached public signature type reference.
334#[derive(Debug, Clone, Encode, Decode)]
335pub struct CachedPublicSignatureTypeReference {
336 /// Exported symbol whose signature contains the reference.
337 pub export_name: String,
338 /// Referenced type name.
339 pub type_name: String,
340 /// Byte offset of the reference span start.
341 pub span_start: u32,
342 /// Byte offset of the reference span end.
343 pub span_end: u32,
344}
345
346/// Cached suppression directive.
347#[derive(Debug, Clone, Encode, Decode)]
348pub struct CachedSuppression {
349 /// 1-based line this suppression applies to. 0 = file-wide.
350 pub line: u32,
351 /// 1-based line where the comment itself appears.
352 pub comment_line: u32,
353 /// 0 = suppress all, 1-20 = `IssueKind` discriminant.
354 pub kind: u8,
355}
356
357/// Cached unknown suppression kind token (see #449).
358#[derive(Debug, Clone, Encode, Decode)]
359pub struct CachedUnknownSuppressionKind {
360 /// 1-based line where the comment itself appears.
361 pub comment_line: u32,
362 /// True when the marker was `fallow-ignore-file`.
363 pub is_file_level: bool,
364 /// The verbatim token that did not parse.
365 pub token: String,
366}
367
368/// Cached export data for a single export declaration.
369#[derive(Debug, Clone, Encode, Decode)]
370pub struct CachedExport {
371 /// Export name (or "default" for default exports).
372 pub name: String,
373 /// Whether this is a default export.
374 pub is_default: bool,
375 /// Whether this is a type-only export.
376 pub is_type_only: bool,
377 /// Whether this export is registered through a runtime side effect at
378 /// module load time (Lit `@customElement` decorator or
379 /// `customElements.define` call). Persisted so warm-cache runs continue
380 /// to skip unused-export reporting for these classes.
381 pub is_side_effect_used: bool,
382 /// Visibility tag discriminant (0=None, 1=Public, 2=Internal, 3=Beta, 4=Alpha).
383 pub visibility: u8,
384 /// The local binding name, if different.
385 pub local_name: Option<String>,
386 /// Byte offset of the export span start.
387 pub span_start: u32,
388 /// Byte offset of the export span end.
389 pub span_end: u32,
390 /// Members of this export (for enums and classes).
391 pub members: Vec<CachedMember>,
392 /// The local name of the parent class from `extends` clause, if any.
393 pub super_class: Option<String>,
394}
395
396/// Cached import data for a single import declaration.
397#[derive(Debug, Clone, Encode, Decode)]
398pub struct CachedImport {
399 /// The import specifier.
400 pub source: String,
401 /// For Named imports, the imported symbol name. Empty for other kinds.
402 pub imported_name: String,
403 /// The local binding name.
404 pub local_name: String,
405 /// Whether this is a type-only import.
406 pub is_type_only: bool,
407 /// Whether this import originated from an SFC `<style>` block / `<style src>` (CSS context).
408 pub from_style: bool,
409 /// Import kind: 0=Named, 1=Default, 2=Namespace, 3=SideEffect.
410 pub kind: u8,
411 /// Byte offset of the import span start.
412 pub span_start: u32,
413 /// Byte offset of the import span end.
414 pub span_end: u32,
415 /// Byte offset of the source string literal span start.
416 pub source_span_start: u32,
417 /// Byte offset of the source string literal span end.
418 pub source_span_end: u32,
419}
420
421/// Cached dynamic import data.
422#[derive(Debug, Clone, Encode, Decode)]
423pub struct CachedDynamicImport {
424 /// The import specifier.
425 pub source: String,
426 /// Byte offset of the span start.
427 pub span_start: u32,
428 /// Byte offset of the span end.
429 pub span_end: u32,
430 /// Names destructured from the import result.
431 pub destructured_names: Vec<String>,
432 /// Local variable name for namespace imports.
433 pub local_name: Option<String>,
434 /// True when this dynamic import was synthesised by fallow (see
435 /// `DynamicImportInfo::is_speculative`).
436 pub is_speculative: bool,
437}
438
439/// Cached `require()` call data.
440#[derive(Debug, Clone, Encode, Decode)]
441pub struct CachedRequireCall {
442 /// The require specifier.
443 pub source: String,
444 /// Byte offset of the span start.
445 pub span_start: u32,
446 /// Byte offset of the span end.
447 pub span_end: u32,
448 /// Names destructured from the require result.
449 pub destructured_names: Vec<String>,
450 /// Local variable name for namespace requires.
451 pub local_name: Option<String>,
452}
453
454/// Cached re-export data.
455#[derive(Debug, Clone, Encode, Decode)]
456pub struct CachedReExport {
457 /// The module being re-exported from.
458 pub source: String,
459 /// Name imported from the source.
460 pub imported_name: String,
461 /// Name exported from this module.
462 pub exported_name: String,
463 /// Whether this is a type-only re-export.
464 pub is_type_only: bool,
465 /// Byte offset of the re-export span start (for line-number reporting).
466 pub span_start: u32,
467 /// Byte offset of the re-export span end.
468 pub span_end: u32,
469}
470
471/// Cached enum or class member data.
472#[derive(Debug, Clone, Encode, Decode)]
473pub struct CachedMember {
474 /// Member name.
475 pub name: String,
476 /// Member kind (enum, method, or property).
477 pub kind: MemberKind,
478 /// Byte offset of the span start.
479 pub span_start: u32,
480 /// Byte offset of the span end.
481 pub span_end: u32,
482 /// Whether this member has decorators.
483 pub has_decorator: bool,
484 /// Full dotted path of each decorator (e.g. `step`, `ns.foo`).
485 /// Empty for undecorated members and decorators with non-identifier
486 /// expressions.
487 pub decorator_names: Vec<String>,
488 /// True when this is a static method that returns a fresh instance of
489 /// the class: body returns `new this()` / `new <SameClassName>()`, or the
490 /// declared return type matches the class name. Treated as a factory.
491 /// See issues #346, #387.
492 pub is_instance_returning_static: bool,
493 /// True when this instance method's call result is an instance of the
494 /// same class (declared return type matches the class name, or body's
495 /// last statement is `return this`). Drives fluent-chain credit. See
496 /// issue #387.
497 pub is_self_returning: bool,
498}
499
500/// Cached dynamic import pattern data (template literals, `import.meta.glob`).
501#[derive(Debug, Clone, Encode, Decode)]
502pub struct CachedDynamicImportPattern {
503 /// Static prefix of the import path.
504 pub prefix: String,
505 /// Static suffix, if any.
506 pub suffix: Option<String>,
507 /// Byte offset of the span start.
508 pub span_start: u32,
509 /// Byte offset of the span end.
510 pub span_end: u32,
511}