Skip to content

Various cleanups#8594

Open
turbolent wants to merge 2 commits into
masterfrom
bastian/extract-cadence-vm-unrelated
Open

Various cleanups#8594
turbolent wants to merge 2 commits into
masterfrom
bastian/extract-cadence-vm-unrelated

Conversation

@turbolent

@turbolent turbolent commented Jun 30, 2026

Copy link
Copy Markdown
Member
  • Extract improvements from feature/cadence-vm unrelated to Cadence VM work
  • Simplify/optimize address conversion

Summary by CodeRabbit

  • Bug Fixes

    • Improved how account addresses are handled in transaction and system contract calls, which may help prevent encoding-related issues.
    • Corrected and clarified several public configuration option names for contract deployment/removal and authorization checks.
  • Style

    • Cleaned up formatting and spacing in workflow, verification, and test files for consistency.
  • Tests

    • Updated test helpers to match the latest address handling and API naming changes.

@turbolent turbolent requested a review from a team as a code owner June 30, 2026 23:25
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR normalizes whitespace in CI workflow conditionals, fixes a misspelled flag variable (flagtransactionFeesDisabledflagTransactionFeesDisabled), renames three FVM Option helper functions, fixes a doc typo, reformats two verifier function signatures, and replaces cadence.BytesToAddress(addr.Bytes()) conversions with direct cadence.Address/cadence.NewAddress wrapping in FVM, benchmark, and integration test code.

Changes

CI Workflow Formatting

Layer / File(s) Summary
Private build environment conditional formatting
.github/workflows/ci.yml
Normalizes whitespace/indentation of the PRIVATE_BUILDS_SUPPORTED conditional across tidy, unit-test, unit-test-insecure, docker-build, integration-test-others, and integration-test jobs; no logic changes.

Go Code Fixes and Renames

Layer / File(s) Summary
Transaction fees flag rename
cmd/util/cmd/verify_execution_result/cmd.go
Renames flagtransactionFeesDisabled to flagTransactionFeesDisabled in its declaration, flag binding, and both VerifyRange/VerifyLastKHeight call sites.
Verifier function formatting
engine/verification/verifier/verifiers.go
Reformats VerifyRange's parameter list and initStorages's makeVerifier call into multi-line argument lists with no behavior change.
FVM context option renames and contract conversion
fvm/context.go, fvm/blueprints/contracts.go, fvm/accounts_test.go
Renames WithRestrictContractRemovalWithContractRemovalRestricted, WithRestrictedContractDeploymentWithContractDeploymentRestricted, WithAuthorizationCheckxEnabledWithAuthorizationChecksEnabled, fixes a comment typo, switches address conversion to cadence.Address(address) in setContractAuthorizersTransaction, and reformats a test method chain.
Cadence address conversion simplification
fvm/environment/system_contracts.go, fvm/environment/system_contracts_test.go, integration/benchmark/scripts/scripts.go, integration/tests/access/cohort3/extended_indexing_test.go, integration/tests/access/cohort3/extended_indexing_transfers_test.go
Replaces cadence.BytesToAddress(addr.Bytes()) with direct cadence.Address(...)/cadence.NewAddress(...) calls across multiple system contract invocations and integration test helpers; updates a test invoke call to pass nil instead of an empty slice.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Suggested labels

Improvement, Preserve

Suggested reviewers

  • zhangchiqing
  • janezpodhostnik

A rabbit hops through code so neat,
Renaming flags with tidy feet,
Addresses wrapped, no bytes to chase,
Each cadence call now finds its place.
🐇✨ Hop, commit, and ship with grace!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too generic to describe the main changes, which include cleanup, renames, formatting, and address conversion updates. Use a more specific title, e.g. "Clean up address conversion and related formatting/rename fixes".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bastian/extract-cadence-vm-unrelated

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Jun 30, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
fvm/context.go (1)

245-250: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep deprecated aliases for the renamed option helpers. Renaming these exported functions breaks downstream callers; add thin deprecated wrappers unless this is meant to be a breaking API change.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@fvm/context.go` around lines 245 - 250, The exported option helper
WithContractRemovalRestricted was renamed and now breaks downstream callers;
keep the new helper but add a thin deprecated wrapper under the old name so
existing users still compile. Update the relevant option helpers in context.go
by preserving the current implementation and introducing the deprecated alias
function that forwards to it, matching the pattern used by other renamed APIs if
present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@fvm/context.go`:
- Around line 245-250: The exported option helper WithContractRemovalRestricted
was renamed and now breaks downstream callers; keep the new helper but add a
thin deprecated wrapper under the old name so existing users still compile.
Update the relevant option helpers in context.go by preserving the current
implementation and introducing the deprecated alias function that forwards to
it, matching the pattern used by other renamed APIs if present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 68f29d81-d58b-4596-b847-5ac1342776a0

📥 Commits

Reviewing files that changed from the base of the PR and between 4c61355 and 91658e4.

📒 Files selected for processing (11)
  • .github/workflows/ci.yml
  • cmd/util/cmd/verify_execution_result/cmd.go
  • engine/verification/verifier/verifiers.go
  • fvm/accounts_test.go
  • fvm/blueprints/contracts.go
  • fvm/context.go
  • fvm/environment/system_contracts.go
  • fvm/environment/system_contracts_test.go
  • integration/benchmark/scripts/scripts.go
  • integration/tests/access/cohort3/extended_indexing_test.go
  • integration/tests/access/cohort3/extended_indexing_transfers_test.go

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