Skip to content

Conversation

dragos-rebegea
Copy link
Contributor

No description provided.

@andreibancioiu andreibancioiu requested a review from Copilot August 28, 2025 11:45
Copy link

@Copilot 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 introduces an address generator system for creating new addresses based on creator address, nonce, and VM type. The address generator uses keccak256 hashing to create addresses with specific prefix and suffix masks.

  • Implements core address generation functionality with proper validation and error handling
  • Adds mock stub for testing purposes
  • Updates project dependencies to newer versions

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
go.mod Updates dependency versions for gorilla/websocket, stretchr/testify, protobuf, and yaml
core/mock/addressGeneratorStub.go Mock implementation of AddressGenerator interface for testing
core/addressGenerator/errors.go Error definitions for address and VM type length validation
core/addressGenerator/addressGenerator_test.go Comprehensive test suite for address generation functionality
core/addressGenerator/addressGenerator.go Main address generator implementation with validation and hashing logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

buffNonce := make([]byte, 8)
binary.LittleEndian.PutUint64(buffNonce, creatorNonce)
adrAndNonce := append(creatorAddress, buffNonce...)
scAddress := keccak.NewKeccak().Compute(string(adrAndNonce))
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

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

Creating a new keccak hasher instance here instead of using the instance stored in ag.hasher field is inefficient and inconsistent.

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