Skip to content

test: add ACP-224 fee manager simulated backend tests#5220

Open
JonathanOppenheimer wants to merge 6 commits intoJonathanOppenheimer/acp224-add-precompilefrom
JonathanOppenheimer/acp-224-add-bindings-test
Open

test: add ACP-224 fee manager simulated backend tests#5220
JonathanOppenheimer wants to merge 6 commits intoJonathanOppenheimer/acp224-add-precompilefrom
JonathanOppenheimer/acp-224-add-bindings-test

Conversation

@JonathanOppenheimer
Copy link
Copy Markdown
Contributor

@JonathanOppenheimer JonathanOppenheimer commented Apr 10, 2026

Why this should be merged

This PR addsthe simulated backend tests for the ACP-224 fee manager precompile, exercising the cross-implementation ABI path through a deployed ACP224FeeManagerTest.sol wrapper contract:

Go abi.Pack() -> wrapper (solc-compiled) -> ABI re-encoding -> precompile -> Go abi.Unpack()

This catches any disagreement between Go's abi package and solc's ABI implementation. Without the wrapper, both sides of the encoding use Go's abi package, so a bug would be invisible. The wrapper forces solc's compiled bytecode between Go's encoder and decoder, making this a cross-implementation integration test with the EVM interpreter.

How this works

  1. The test deploys ACP224FeeManagerTest.sol on a simulated backend and enables it on the precompile's allowlist
  2. Fee config operations (setFeeConfig, getFeeConfig, getFeeConfigLastChangedAt) are routed through the wrapper
  3. Allowlist operations and event filtering use the IACP224FeeManager interface binding directly against the precompile address

How this was tested

Run all the tests in simulated_test.go

Need to be documented in RELEASES.md?

No

@JonathanOppenheimer JonathanOppenheimer self-assigned this Apr 10, 2026
@JonathanOppenheimer JonathanOppenheimer requested a review from a team as a code owner April 10, 2026 03:55
@JonathanOppenheimer JonathanOppenheimer added the evm Related to EVM functionality label Apr 10, 2026
errTargetGasTooLowACP224 = errors.New("targetGas must be at least MinTargetGasACP224")
errTimeToDoubleTooLow = errors.New("timeToDouble must be greater than 0")
errTimeToDoubleMustBeZero = errors.New("timeToDouble must be 0 when staticPricing is true")
ErrTargetGasMustBeZero = errors.New("targetGas must be 0 when validatorTargetGas is true")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We export these errors for use in the test.

@JonathanOppenheimer JonathanOppenheimer force-pushed the JonathanOppenheimer/acp-224-add-bindings-test branch from bc39c9d to ed56a19 Compare April 10, 2026 04:05
params.RegisterExtras()
// TODO(JonathanOppenheimer): Remove manual registration when the
// module is registered unconditionally in init().
if err := modules.RegisterModule(acp224feemanager.Module); err != nil {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The converse if true didn't really make sense here. I think a TODO is okay?

@JonathanOppenheimer JonathanOppenheimer added the DO NOT MERGE This PR must not be merged in its current state label Apr 10, 2026
@JonathanOppenheimer JonathanOppenheimer marked this pull request as draft April 10, 2026 15:23
@JonathanOppenheimer JonathanOppenheimer linked an issue Apr 13, 2026 that may be closed by this pull request
@JonathanOppenheimer
Copy link
Copy Markdown
Contributor Author

Waiting on a clarification before proceeding here.

//
// catching any disagreement between Go's ABI package and solc's ABI
// implementation. Note that some tests overlap with contract_test.go (e.g. fee config
// validation) but the overlap is intentional: contract_test.go tests precompile
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I know the test coverage double dips to some extent.

@JonathanOppenheimer JonathanOppenheimer marked this pull request as ready for review April 16, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO NOT MERGE This PR must not be merged in its current state evm Related to EVM functionality

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Add ACP224FeeManager bindings test

1 participant