Skip to content

Conversation

@dhil
Copy link
Contributor

@dhil dhil commented Nov 11, 2025

No description provided.

Copilot finished reviewing on behalf of dhil November 11, 2025 15:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive death tests to verify assertion violations for state override functions in the RPC executor. The tests ensure that the C API properly validates inputs and fails gracefully when given invalid parameters.

  • Adds 22 test cases covering null pointers, invalid lengths, operations on non-existent addresses, and duplicate insertions
  • Uses GoogleTest's EXPECT_DEATH framework with the "DeathTest" naming convention to safely test assertion failures
  • Validates all state override API functions including add_override_address, set_override_balance, set_override_nonce, set_override_code, set_override_state, and set_override_state_diff

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dhil dhil force-pushed the dhil/garbage-overrides branch from ec67687 to 86f4076 Compare November 11, 2025 15:51
@dhil dhil requested a review from Copilot November 11, 2025 15:57
Copilot finished reviewing on behalf of dhil November 11, 2025 16:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3583 to +3584
{
evmc::bytes const code = evmc::from_hex("0x00").value();
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The code variable is declared in the outer scope but is only used for testing set_override_code within the loop. Consider moving this declaration inside the loop where it's used (around line 3605-3608), or alternatively, moving it outside the block entirely to line 3582 if it's meant to be shared across multiple test sections. This would improve code clarity and scope management.

Copilot uses AI. Check for mistakes.
delete[] value;
}

// Test 14: set state diff overwrite existing key overwrite
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The comment contains redundant wording with "overwrite" appearing twice. Consider simplifying to "Test 14: attempt to overwrite existing state diff key" or "Test 14: set state diff with existing key".

Suggested change
// Test 14: set state diff overwrite existing key overwrite
// Test 14: attempt to overwrite existing state diff key

Copilot uses AI. Check for mistakes.
delete[] value;
}

// Test 20: set state overwrite existing key overwrite
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The comment contains redundant wording with "overwrite" appearing twice. Consider simplifying to "Test 20: attempt to overwrite existing state key" or "Test 20: set state with existing key".

Suggested change
// Test 20: set state overwrite existing key overwrite
// Test 20: attempt to overwrite existing state key

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants