chore(riscv-guest): More tests - #3775
Open
Filter94 wants to merge 2 commits into
Open
Conversation
Signed-off-by: Roman <4833306+Filter94@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the riscv-guests/l2-execution test suite by adding a shared transaction-fixture builder capable of producing deterministically signed, sender-recoverable transactions (legacy + typed), and by adding several new unit tests that harden SSZ decoding and forced-transaction validation logic.
Changes:
- Added
tx_fixtures.zig: reusable legacy/EIP-1559/EIP-4844/EIP-7702 transaction encoders plus deterministic secp256k1 signing for tests. - Extended
l2_execution_test.zig,l2_execution_ssz_test.zig, andl2_execution_range_test.zigwith additional negative/edge-case coverage (forced-tx validation, adversarial SSZ offsets/truncation, and bridge-message behaviors). - Updated
build.zigmodule wiring to expose the new fixtures module and remove the legacy-only encoder module.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| riscv-guests/l2-execution/test/tx_fixtures.zig | New shared transaction fixture builders (RLP encoders + deterministic signing) for multiple tx types. |
| riscv-guests/l2-execution/test/stateless_input_encode_test.zig | Switched legacy tx RLP usage to the new tx_fixtures module. |
| riscv-guests/l2-execution/test/legacy_tx_rlp.zig | Removed legacy-only RLP helper in favor of consolidated fixtures. |
| riscv-guests/l2-execution/test/l2_execution_test.zig | Added new forced-transaction validation tests and sender recovery helper for newly generated tx fixtures. |
| riscv-guests/l2-execution/test/l2_execution_ssz_test.zig | Added adversarial-input hardening tests around SSZ offset/bounds/ordering behavior. |
| riscv-guests/l2-execution/test/l2_execution_range_test.zig | Updated range tests to use shared tx fixtures and added new bridge-related scenario coverage. |
| riscv-guests/l2-execution/src/l2_execution.zig | Comment/documentation clarifications around reference implementation and storage layout provenance. |
| riscv-guests/l2-execution/build.zig | Introduced tx_fixtures module wiring (including secp256k1 wrapper copy) and removed legacy encoder wiring. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+178
to
+182
| fn versionedHashesRlp(alloc: std.mem.Allocator, hashes: []const [32]u8) ![]const u8 { | ||
| const items = try alloc.alloc([]const u8, hashes.len); | ||
| for (hashes, 0..) |h, i| items[i] = try rlp.encodeBytes(alloc, &h); | ||
| return rlp.encodeList(alloc, items); | ||
| } |
…eth/lineth-monorepo into test/l2-exec-guest-coverage-pr2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements issue(s) #
Checklist
PR.