Skip to content

New Release#455

Merged
emmanuelm41 merged 6 commits into
mainfrom
dev
Jul 8, 2025
Merged

New Release#455
emmanuelm41 merged 6 commits into
mainfrom
dev

Conversation

@emmanuelm41
Copy link
Copy Markdown
Member

@emmanuelm41 emmanuelm41 commented Jul 7, 2025

🔗 zboto Link

Summary by CodeRabbit

  • Refactor

    • Renamed fields in miner information displays for improved clarity. "ActorAddress" is now shown as "MinerAddress" and "Value" as "Data" in all relevant areas, including JSON outputs and user-facing miner details.
    • Enhanced miner event processing to support multiple transaction types with improved address consolidation and metadata updates.
    • Updated actor information retrieval across the system to use a unified method that provides richer actor details and better handles special address types.
    • Improved address consolidation in sector event parsing, including nested piece activation manifests, for more accurate event data.
    • Added configuration-driven address consolidation for multisig events, enhancing signer address normalization and error handling.
  • Tests

    • Updated tests to reflect the new field names in miner information.

* fix: change actor_address to miner_address

* fix: change value to data
@emmanuelm41 emmanuelm41 requested a review from ziscky July 7, 2025 12:55
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 7, 2025

Walkthrough

The changes rename two fields in the MinerInfo struct from ActorAddress to MinerAddress and from Value to Data, including updates to their JSON tags. The createMinerInfo method in the miner event generator is extended to handle multiple miner-related transaction types with dedicated parsing functions and address consolidation logic. Calls to retrieve actor information are updated throughout the codebase to use a new helper method returning richer actor info. Several dependencies are upgraded, and miner sector event parsing is enhanced with address consolidation for nested fields.

Changes

File(s) Change Summary
types/miner.go Renamed ActorAddress to MinerAddress and Value to Data in MinerInfo struct, updated JSON tags.
tools/miner/info.go Replaced single miner tx type handling with switch dispatch to new parsing functions; added address consolidation and updated MinerInfo field usage.
tools/miner/miner.go Added config field to eventGenerator; updated constructor and actor info retrieval to use new helper method.
tools/miner/sector.go Enhanced sector prove-commit parsing to consolidate nested addresses in sector activations and piece manifests; added related constants and helper method.
tools/miner/miner_test.go Updated test setup to pass config; renamed ActorAddress to MinerAddress in test data and assertions.
parser/helper/helpers.go Added constants and new methods for actor info retrieval; refactored GetActorNameFromAddress to call new GetActorInfoFromAddress; added handling for EAM space addresses.
parser/v1/parser.go Added minerEventGenerator field and initialization; replaced actor info calls to use new helper method.
parser/v2/parser.go Updated miner event generator initialization to include config; replaced actor info calls to use new helper method.
actors/v1/actor.go Replaced call from GetActorNameFromAddress to GetActorInfoFromAddress in GetMetadata method.
actors/v2/init/init.go Changed fallback actor info retrieval call to GetActorInfoFromAddress instead of GetActorNameFromAddress.
actors/v2/multisig/propose.go Removed unused blank identifier in assignment from GetActorNameFromAddress.
factory.go Replaced call to GetActorNameFromAddress with GetActorInfoFromAddress in genesis address info retrieval.
tools/multisig/multisig.go Replaced call to GetActorNameFromAddress with GetActorInfoFromAddress in multisig event generation; added config field and address consolidation for signer addresses.
go.mod Bumped multiple dependencies to newer versions without changing module requirements or replacements.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant EventGenerator
    participant MinerInfo

    Caller->>EventGenerator: createMinerInfo(tx, tipsetCid, actorAddress)
    alt tx is AwardBlockReward
        EventGenerator->>MinerInfo: parseAwardBlockReward(tx, tipsetCid)
    else tx is Constructor
        EventGenerator->>MinerInfo: parseConstructor(tx, tipsetCid, actorAddress)
    else tx is ChangeWorkerAddress
        EventGenerator->>MinerInfo: parseChangeWorkerAddress(tx, tipsetCid, actorAddress)
    else tx is ChangeMultiaddrs
        EventGenerator->>MinerInfo: parseChangeMultiaddrs(tx, tipsetCid, actorAddress)
    else tx is ChangeBeneficiary
        EventGenerator->>MinerInfo: parseChangeBeneficiary(tx, tipsetCid, actorAddress)
    else tx is ChangeOwnerAddress
        EventGenerator->>MinerInfo: parseChangeOwnerAddress(tx, tipsetCid, actorAddress)
    end
    MinerInfo-->>EventGenerator: MinerInfo instance with consolidated addresses
    EventGenerator-->>Caller: Return MinerInfo with updated fields
Loading
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

ziscky and others added 4 commits July 8, 2025 13:13
* feat: refactor GetActorNameFromAddress to GetActorInfoFromAddress

* feat: create GetActorNameFromAddress fn with protocol fallback

* feat: use GetActorNameFromAddress in msig propose

* fix: use consts
* feat: consolidate addresses in miner data

* fix: build

* feat: consolidate addresses in sector messages

* fix: add empty map checks
Bumps [github.com/zondax/golem](https://github.com/zondax/golem) from 0.23.0 to 0.26.0.
- [Release notes](https://github.com/zondax/golem/releases)
- [Commits](Zondax/golem@v0.23.0...v0.26.0)

---
updated-dependencies:
- dependency-name: github.com/zondax/golem
  dependency-version: 0.26.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](go-viper/mapstructure@v2.2.1...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.3.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Emmanuel <emmanuelm41@gmail.com>
Co-authored-by: Eric Mokaya <4112301+ziscky@users.noreply.github.com>
Co-authored-by: Emmanuel <e.m.m.a.n.u.e.l.m.41@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sara Elzayat <st.elzayat@gmail.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
tools/miner/sector.go (1)

281-296: Consider consolidating error messages.

The address consolidation logic is correctly implemented. However, all error messages use the same generic text.

-			return nil, fmt.Errorf("error parsing sealer id: %w", err)
+			return nil, fmt.Errorf("error converting sealer id to address: %w", err)
-			return nil, fmt.Errorf("error consolidating sealer id: %w", err)
+			return nil, fmt.Errorf("error consolidating sealer address to robust format: %w", err)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between fb955ed and 3abc880.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (13)
  • actors/v1/actor.go (1 hunks)
  • actors/v2/init/init.go (1 hunks)
  • actors/v2/multisig/propose.go (1 hunks)
  • factory.go (1 hunks)
  • go.mod (5 hunks)
  • parser/helper/helpers.go (7 hunks)
  • parser/v1/parser.go (5 hunks)
  • parser/v2/parser.go (3 hunks)
  • tools/miner/info.go (2 hunks)
  • tools/miner/miner.go (2 hunks)
  • tools/miner/miner_test.go (3 hunks)
  • tools/miner/sector.go (5 hunks)
  • tools/multisig/multisig.go (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • actors/v2/multisig/propose.go
  • go.mod
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/miner/miner_test.go
🧰 Additional context used
🧬 Code Graph Analysis (3)
tools/miner/miner.go (3)
parser/config.go (1)
  • Config (3-13)
parser/helper/helpers.go (1)
  • Helper (140-147)
metrics/client.go (1)
  • MetricsClient (12-15)
tools/miner/info.go (6)
types/transaction.go (1)
  • Transaction (14-46)
types/miner.go (1)
  • MinerInfo (9-17)
parser/constants.go (6)
  • MethodAwardBlockReward (75-75)
  • MethodConstructor (48-48)
  • MethodChangeWorkerAddress (101-101)
  • MethodChangeMultiaddrs (108-108)
  • MethodChangeBeneficiary (124-124)
  • MethodChangeOwnerAddress (99-99)
tools/tools.go (1)
  • BuildId (30-41)
actors/address.go (1)
  • ConsolidateToRobustAddress (16-43)
tools/miner/sector.go (1)
  • KeyParams (24-24)
parser/v1/parser.go (3)
tools/miner/miner.go (2)
  • EventGenerator (22-24)
  • NewEventGenerator (35-42)
tools/multisig/multisig.go (2)
  • EventGenerator (52-54)
  • NewEventGenerator (62-68)
logger/logger.go (1)
  • GetSafeLogger (7-17)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: tests
  • GitHub Check: build
  • GitHub Check: checks
  • GitHub Check: tests
  • GitHub Check: build
  • GitHub Check: checks
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (go)
🔇 Additional comments (26)
tools/multisig/multisig.go (1)

103-103: LGTM: Consistent with codebase-wide actor info retrieval refactor.

The change from GetActorNameFromAddress to GetActorInfoFromAddress aligns with the broader refactor to centralize actor information retrieval. The CID return value is appropriately ignored since only the actor name is needed for the multisig actor type check.

actors/v1/actor.go (1)

44-44: LGTM: Proper actor info retrieval update.

The change to GetActorInfoFromAddress is consistent with the codebase refactor and correctly ignores the CID return value since only the actor name is needed for the subsequent actor type switch statement.

factory.go (1)

528-528: LGTM: Genesis address processing updated consistently.

The change to GetActorInfoFromAddress is appropriate for genesis address processing and follows the consistent pattern across the codebase. The CID is correctly ignored since only the actor name is needed for the address info construction.

actors/v2/init/init.go (1)

176-176: LGTM: Enhanced actor info retrieval with both CID and name.

This change effectively utilizes both return values from GetActorInfoFromAddress, providing richer actor information for the init actor processing. This demonstrates the benefit of the refactor by returning both gotActorCid and gotActorName instead of just the name.

tools/miner/miner.go (3)

32-32: LGTM: Configuration field added for address consolidation.

The addition of the config field supports address consolidation features in miner event generation, as indicated by the ConsolidateRobustAddress and RobustAddressBestEffort flags in the parser.Config struct.


35-35: LGTM: Constructor updated to accept configuration.

The constructor signature change and field initialization are consistent with the config field addition, enabling configuration-driven miner event generation.

Also applies to: 40-40


68-68: LGTM: Actor info retrieval updated consistently.

The change from GetActorNameFromAddress to GetActorInfoFromAddress follows the same pattern as other files in this refactor. The CID is appropriately ignored since only the actor name is needed for the miner actor type check.

parser/v2/parser.go (2)

72-72: LGTM!

The addition of the config parameter to the miner event generator constructor is consistent with the initialization pattern used for other components in the parser.

Also applies to: 90-90


602-602: LGTM!

The migration to GetActorInfoFromAddress is consistent with the codebase-wide refactoring. The actor CID is appropriately discarded since only the actor name is needed in this context.

parser/v1/parser.go (3)

30-30: LGTM!

The addition of the miner tools import and the minerEventGenerator field properly extends the v1 parser with miner event generation capabilities, maintaining consistency with the v2 parser structure.

Also applies to: 48-48


70-70: LGTM!

The miner event generator initialization follows the same pattern as the multisig event generator and correctly passes all required dependencies including the config parameter.

Also applies to: 85-85


514-514: LGTM!

The method call update is consistent with the v2 parser implementation and correctly handles the additional return value.

parser/helper/helpers.go (5)

69-71: LGTM!

The new constants are well-documented and appropriately named for their purposes.


178-219: LGTM!

The new GetActorAddressInfo method provides a comprehensive actor information structure with proper error handling and special case handling for zero address actors.


242-278: LGTM!

The GetActorInfoFromAddress method is well-designed with:

  • Proper handling of special account actors
  • Smart retry logic for placeholder actors using on-chain data
  • Comprehensive error handling and logging

192-192: LGTM!

All method calls have been consistently updated to use GetActorInfoFromAddress with proper handling of the additional return values.

Also applies to: 223-223, 351-351, 437-437, 449-449


221-240: EAM space address prefix is explicitly defined

The f410 prefix is declared and documented in parser/helper/helpers.go, confirming this assumption:

  • File: parser/helper/helpers.go
    Line: where EamSpaceAddressPrefix = "f410" is defined with the comment
    // EamSpaceAddressPrefix f410 is the prefix addresses managed by the eam actor

Since this constant and its purpose are clearly documented in code, the heuristic for treating f410… delegated addresses as EVM actors is valid. No further changes required.

tools/miner/sector.go (4)

8-8: LGTM!

The new imports are necessary for the address consolidation functionality being added.

Also applies to: 11-11


18-35: LGTM!

The new constants follow a consistent naming pattern and are well-organized for parsing various miner sector event fields.


307-307: LGTM!

The addition of the context parameter and the conditional address consolidation for pieces is well-implemented. The context parameter appears to be added for future use, which is a good forward-thinking design.

Also applies to: 319-331


431-482: Well-structured nested address consolidation!

The consolidatePieceActivationManifests method excellently handles the complex nested structure with:

  • Proper error handling at each parsing step
  • Performance optimization through slice pre-allocation
  • Clear separation of concerns for different field types
tools/miner/info.go (5)

7-8: LGTM!

The new imports are necessary for the address parsing and consolidation functionality.


14-24: LGTM!

The constants are well-named and organized for parsing various miner transaction metadata fields.


26-54: Excellent refactoring with dedicated parsers!

The switch statement provides clean separation of concerns by delegating to specialized parsing methods for each transaction type. The field rename to MinerAddress is consistent with the type definition changes.


56-90: LGTM!

The parseAwardBlockReward method correctly extracts and consolidates the miner address with proper error handling at each step.


341-378: LGTM for parseChangeOwnerAddress!

This method has more appropriate error messages compared to the others. The implementation correctly handles owner address consolidation.

Comment thread tools/miner/info.go
Comment thread tools/miner/info.go
* feat: consolidate signer address

* feat: consolidate AddSigner & RemoveSigner

* feat: consolidate Constructor signers
@emmanuelm41 emmanuelm41 merged commit f0f633c into main Jul 8, 2025
11 of 12 checks passed
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tools/multisig/multisig.go (1)

218-265: Consider refactoring address consolidation logic to reduce duplication.

The address consolidation logic is functionally correct but contains significant code duplication between the add/remove signer and constructor cases. Consider extracting common consolidation logic into helper functions.

Example refactor:

+func (eg *eventGenerator) consolidateSignerAddress(signerAddr string) (string, error) {
+	addr, err := address.NewFromString(signerAddr)
+	if err != nil {
+		return "", fmt.Errorf("address.NewFromString(%s): %s", signerAddr, err)
+	}
+	return actors.ConsolidateToRobustAddress(addr, eg.helper, eg.logger, eg.config.RobustAddressBestEffort)
+}
+
+func (eg *eventGenerator) consolidateSignerAddresses(signers []string) ([]string, error) {
+	consolidated := make([]string, 0, len(signers))
+	for _, signer := range signers {
+		robustAddr, err := eg.consolidateSignerAddress(signer)
+		if err != nil {
+			return nil, err
+		}
+		consolidated = append(consolidated, robustAddr)
+	}
+	return consolidated, nil
+}

This would reduce the duplication and make the code more maintainable.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3abc880 and ba16ccf.

📒 Files selected for processing (3)
  • parser/v1/parser.go (5 hunks)
  • parser/v2/parser.go (3 hunks)
  • tools/multisig/multisig.go (11 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • parser/v1/parser.go
  • parser/v2/parser.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: checks
  • GitHub Check: tests
  • GitHub Check: build
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (go)
  • GitHub Check: tests
  • GitHub Check: checks
🔇 Additional comments (8)
tools/multisig/multisig.go (8)

9-9: LGTM: Import added for address consolidation functionality.

The new import is necessary for the address consolidation logic implemented later in the file.


37-38: LGTM: Constants properly defined for metadata fields.

The new constants are well-named and improve code maintainability by avoiding magic strings.


63-63: LGTM: Configuration support properly integrated.

The config field addition and constructor updates are well-implemented and follow consistent patterns.

Also applies to: 66-66, 71-71


95-98: LGTM: Improved error handling.

The error handling for createProposal is now properly implemented instead of being silently ignored.


132-132: LGTM: Method signature updated to return error.

The createProposal method now properly returns an error, improving error handling consistency.

Also applies to: 148-148


310-320: LGTM: Helper functions are simple and correct.

The helper functions isAddOrRemoveSigner and isConstructor are well-implemented and improve code readability.


353-353: LGTM: Helpful comment about address type.

The comment clarifies that the address is already robust, which is useful context for developers.


111-111: All GetActorInfoFromAddress calls match the updated signature
A repository-wide search confirms every invocation unpacks three return values (cid.Cid, string, error), with the second value consistently treated as the actor name. No mismatched arity or lingering calls to the old method remain.

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