AgentSkillsCN

upgrade-block-guardrail

在TokamakL2JS中,守护`src/block/`升级的安全性。在修改区块构造函数/类型、交易到区块的组装行为、区块头到交易的gasLimit传播,或通过`src/index.ts`导出的区块创建接口时使用。

SKILL.md
--- frontmatter
name: upgrade-block-guardrail
description: Guard `src/block/` upgrade safety in TokamakL2JS. Use when changing block constructors/types, tx-to-block assembly behavior, header-to-tx gasLimit propagation, or block creation interfaces exported through `src/index.ts`.

Block Guardrail

Use this skill to block regressions in block assembly behavior.

Quick Start

bash
npm run build
node agents/skills/upgrade-block-guardrail/scripts/block-smoke.mjs

What the Smoke Check Verifies

  1. createTokamakL2Block constructs a block with expected tx count.
  2. Header gasLimit is propagated into tx gasLimit.
  3. Fixed-vector block hash remains stable.
  4. Missing common.customCrypto path still fails fast.

Workflow

  1. Run smoke script before and after changes under src/block/.
  2. Treat gasLimit propagation mismatch, block hash drift, or missing-fast-fail behavior as blocking.
  3. Run npm run build and block merge on failure.

Reporting

Capture:

  • changed files under src/block/
  • smoke script pass/fail
  • intentional behavior changes and migration notes

Use expected behavior checklist in references/acceptance-checks.md.