Skip to content

Add Mesh API compatibility tests - #11

Open
Frozen wants to merge 2 commits into
devfrom
mesh-api-integration
Open

Add Mesh API compatibility tests#11
Frozen wants to merge 2 commits into
devfrom
mesh-api-integration

Conversation

@Frozen

@Frozen Frozen commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a pinned Coinbase Mesh CLI localnet flow for Harmony Data and Construction API checks on shards 0 and 1
  • add test-mesh targets and a dedicated GitHub Actions integration job while preserving the existing Rosetta targets as compatibility aliases
  • restore the native RosettaBlockTracer required by /block/transaction, including revert-aware synthetic staking balance logs
  • keep the external harmony-test checkout pinned and preserve checker failures through tee with pipefail

Coinbase renamed the project to Mesh CLI, but its latest official release, v0.10.4, still installs the command as rosetta-cli. The Docker build uses that stable release rather than the unreleased binary rename from coinbase/mesh-cli#426.

[Test]

  • make test
  • go test ./hmy/tracers/native ./hmy ./rosetta/services
  • go vet ./hmy/tracers/native ./hmy ./rosetta/services
  • bash test/localnet_runner_test.sh
  • shellcheck test/localnet.sh test/mesh.sh test/localnet_runner_test.sh test/all.sh
  • actionlint .github/workflows/ci-pr.yaml
  • arm64 Docker build and stable Mesh CLI v0.10.4 smoke checks
  • full arm64 localnet Mesh E2E: Construction and Data API checks for shards 0 and 1, 0 failed reconciliations, 100% reconciliation coverage

Frozen added 2 commits August 12, 2026 20:23
Register the native RosettaBlockTracer, return its typed result, and preserve EVM revert semantics for synthetic balance logs.
Run pinned Coinbase Mesh CLI Data and Construction checks against both Harmony shards locally and in GitHub Actions while preserving Rosetta target aliases.
@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds pinned Mesh CLI localnet integration coverage and restores a native Rosetta tracer for contract and staking balance operations.

  • Adds Mesh-compatible localnet scripts, Make targets, documentation, and an amd64 CI job.
  • Pins and validates the Mesh CLI release while preserving checker failures through tee.
  • Adds Rosetta trace generation with synthetic staking-log revert tracking and unit tests.

Confidence Score: 4/5

The PR should not merge until synthetic Rosetta log tracking correctly handles nested CREATE and CREATE2 frames.

Nested contract creation can misalign the new frame stack, allowing a staking balance movement rolled back by a caught call revert to be reported as successful.

Files Needing Attention: hmy/tracers/native/rosetta.go

Important Files Changed

Filename Overview
hmy/tracers/native/rosetta.go Introduces the native Rosetta tracer, but its synthetic-log frame stack becomes misaligned after nested contract creation.
hmy/tracer.go Returns the tracer's typed Rosetta result to internal service callers.
test/localnet.Dockerfile Pins Mesh CLI v0.10.4 and safely rewrites checker logging while retaining pipeline failures.
test/localnet.sh Adds Mesh mode while retaining Rosetta as a compatibility alias.
.github/workflows/ci-pr.yaml Adds a dedicated amd64 Mesh API integration job using pinned test inputs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Contract CALL begins] --> B[Staking precompile adds synthetic log]
    B --> C[Nested CREATE pushes frame boundary]
    C --> D[CREATE returns without CaptureExit]
    D --> E[Contract CALL reverts]
    E --> F[CALL exit pops CREATE boundary]
    F --> G[Ancestor catches revert and transaction succeeds]
    G --> H[Synthetic log remains successful]
    H --> I[Incorrect Rosetta operation emitted]
Loading

Reviews (1): Last reviewed commit: "test: add Mesh API compatibility checks" | Re-trigger Greptile

Comment on lines +41 to +47
func (rbt *RosettaBlockTracer) CaptureEnter(_ vm.OpCode, _ common.Address, _ common.Address, _ []byte, _ uint64, _ *big.Int) {
rbt.frameStart = append(rbt.frameStart, len(rbt.logs))
}

func (rbt *RosettaBlockTracer) CaptureExit(_ []byte, _ uint64, err error) {
rbt.markCurrentFrame(err)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Nested CREATE corrupts frame tracking

When a contract calls a staking precompile, subsequently executes CREATE or CREATE2, and then reverts while an ancestor catches the failure, the unmatched creation frame causes CaptureExit to pop the wrong synthetic-log boundary. The reverted staking movement remains marked successful and is emitted as a successful Rosetta operation, producing incorrect transaction data and potential reconciliation failures.

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.

1 participant