Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
Reviewer's GuideIntroduces a generic AST-based linting framework and migrates the keccak256 gas lint to an early AST pass, adds Cancun parent beacon block root processing in cast run/tracing, hardens filesystem and npm workflows against unsafe inputs, improves Solidity documentation output, normalizes gas simulation output, and adds a self-contained example counter Foundry project with dedicated CI and multiple new Docker/cloud security workflows. Sequence diagram for Cancun beacon block root processing in cast runsequenceDiagram
actor User
participant CastCLI
participant RunArgs
participant TracingExecutor
participant EvmEnv
participant Storage as BeaconRootsStorage
User->>CastCLI: invoke cast run ...
CastCLI->>RunArgs: parse and build RunArgs
RunArgs->>EvmEnv: create initial EVM env
RunArgs->>CastCLI: fetch block (with header)
CastCLI-->>RunArgs: Block{ header, parent_beacon_block_root }
RunArgs->>EvmEnv: set block_env fields
alt spec >= CANCUN
RunArgs->>RunArgs: parent_beacon_block_root = header.parent_beacon_block_root
else
RunArgs->>RunArgs: parent_beacon_block_root = None
end
RunArgs->>TracingExecutor: new_with_env(...)
TracingExecutor-->>RunArgs: executor
alt parent_beacon_block_root is Some
RunArgs->>RunArgs: timestamp = block_env.timestamp as u64
RunArgs->>TracingExecutor: process_beacon_block_root(timestamp, parent_beacon_block_root)
activate TracingExecutor
TracingExecutor->>TracingExecutor: compute timestamp_index, root_index
TracingExecutor->>Storage: set_storage_slot(BEACON_ROOTS_ADDRESS, timestamp_slot, block_timestamp)
TracingExecutor->>Storage: set_storage_slot(BEACON_ROOTS_ADDRESS, root_slot, beacon_root)
deactivate TracingExecutor
end
RunArgs->>TracingExecutor: execute transaction trace
TracingExecutor-->>CastCLI: traced execution result
CastCLI-->>User: display trace including Cancun beacon root context
Class diagram for new AST-based linting framework and keccak256 lintclassDiagram
direction LR
class Linter {
<<interface>>
+lint(input : [PathBuf]) void
%% associated types
+Language
+Lint
}
class Lint {
<<interface>>
+id() str
+severity() Severity
+description() str
+help() str
}
class LintContext {
-sess : Session
-desc : bool
+new(sess : Session, with_description : bool) LintContext
+emit(lint : L, span : Span) void
}
class EarlyLintPass {
<<interface>>
+check_expr(ctx : LintContext, expr : Expr) void
+check_item_struct(ctx : LintContext, strukt : ItemStruct) void
+check_item_function(ctx : LintContext, func : ItemFunction) void
+check_variable_definition(ctx : LintContext, var : VariableDefinition) void
}
class EarlyLintVisitor {
+ctx : LintContext
+passes : [EarlyLintPass]
+visit_expr(expr : Expr) ControlFlow
+visit_variable_definition(var : VariableDefinition) ControlFlow
+visit_item_struct(strukt : ItemStruct) ControlFlow
+visit_item_function(func : ItemFunction) ControlFlow
}
class AsmKeccak256 {
+check_expr(ctx : LintContext, expr : Expr) void
}
class Session
class Severity
class Span
class Expr {
+kind : ExprKind
+span : Span
}
class ExprKind {
<<enumeration>>
Call
Ident
}
class ItemStruct
class ItemFunction
class VariableDefinition
class DiagBuilder
class DiagId
class MultiSpan
Linter --> Lint : uses
Linter --> Session : for diagnostics
LintContext --> Session : holds
LintContext --> Lint : emit
LintContext --> Span : positions
LintContext --> DiagBuilder : builds
LintContext --> DiagId : codes
LintContext --> MultiSpan : spans
EarlyLintPass --> LintContext : parameter
EarlyLintPass --> Expr : parameter
EarlyLintPass --> ItemStruct : parameter
EarlyLintPass --> ItemFunction : parameter
EarlyLintPass --> VariableDefinition : parameter
EarlyLintVisitor --> LintContext : ctx
EarlyLintVisitor --> EarlyLintPass : passes
EarlyLintVisitor ..|> Visit
AsmKeccak256 ..|> EarlyLintPass
AsmKeccak256 --> ExprKind : inspects
AsmKeccak256 --> LintContext : emits
class Visit {
<<interface>>
+visit_expr(expr : Expr) ControlFlow
+visit_variable_definition(var : VariableDefinition) ControlFlow
+visit_item_struct(strukt : ItemStruct) ControlFlow
+visit_item_function(func : ItemFunction) ControlFlow
}
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Code Review
This pull request updates Foundry to version 1.6.0, incorporating revm v34 and setting the default EVM version to Osaka. Key enhancements include parallel fuzzing with a synchronized corpus, an optimization mode for invariant tests to maximize int256 return values, and refined reentrancy simulation. The review identified a compilation error in the invariant check interval logic and high-severity issues in parallel fuzzing, specifically regarding log aggregation and seed collisions. Additionally, the optimization sequence shrinker needs to account for trailing block state adjustments, and a confusing comment about reverted calls should be moved for better clarity.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
…ed in path expression' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
…ed in path expression' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
) Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.44.0 to 1.45.0. - [Release notes](https://github.com/crate-ci/typos/releases) - [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md) - [Commits](crate-ci/typos@631208b...cf5f1c2) --- updated-dependencies: - dependency-name: crate-ci/typos dependency-version: 1.45.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
| fs::copy(file, to_dir.join(name))?; | ||
| let file = entry?.path(); | ||
| // Only operate on regular files to avoid following symlinks or directories | ||
| let metadata = fs::symlink_metadata(&file)?; |
| } else { | ||
| continue; | ||
| } | ||
| fs::copy(&file, to_dir.join(name))?; |
| lib_paths: project.paths.libraries.clone(), | ||
| hardhat: config.profile == Config::HARDHAT_PROFILE, | ||
| config_path: if config_path.exists() { Some(config_path) } else { None }, | ||
| config_path: config_path.exists().then_some(config_path), |
clippy: enable `needless_for_each` Amp-Thread-ID: https://ampcode.com/threads/T-019d8707-07ff-77cf-b7f2-5dc0f64200ec Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
Motivation
Solution
PR Checklist
Summary by Sourcery
Introduce a new generic linting infrastructure for early AST-based checks, add Cancun beacon block root handling to cast run tracing, and tighten various security, tooling, and documentation aspects across the repo.
New Features:
Bug Fixes:
Enhancements:
Build:
CI:
Documentation:
Tests:
Chores: