Skip to content

Conversation

@miiu96
Copy link
Contributor

@miiu96 miiu96 commented Mar 28, 2025

Reasoning behind the pull request

  • Fix bitm

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

Base automatically changed from feat/andromeda-fixes to rc/andromeda March 28, 2025 17:46
@github-actions
Copy link

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: e7c1f0ace17f7a968deba62403a36d2bfb777288
  • Current Branch: fix-bitmap
  • mx-chain-go Target Branch: rc/andromeda
  • mx-chain-simulator-go Target Branch: rc/andromeda
  • mx-chain-testing-suite Target Branch: rc/andromeda

🚀 Environment Variables:

  • TIMESTAMP: 31032025-082036
  • PYTEST_EXIT_CODE: 0
    🎉 MultiversX CI/CD Workflow Complete!

@github-actions
Copy link

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 528464809459ac64cf53499431e96282a89bdbf3
  • Current Branch: fix-bitmap
  • mx-chain-go Target Branch: rc/andromeda
  • mx-chain-simulator-go Target Branch: rc/andromeda
  • mx-chain-testing-suite Target Branch: rc/andromeda

🚀 Environment Variables:

  • TIMESTAMP: 31032025-090452
  • PYTEST_EXIT_CODE: 0
    🎉 MultiversX CI/CD Workflow Complete!

@github-actions
Copy link

github-actions bot commented Apr 1, 2025

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: f21353b966a9aea09d4d6b6c6ff162f63a635460
  • Current Branch: fix-bitmap
  • mx-chain-go Target Branch: rc/andromeda
  • mx-chain-simulator-go Target Branch: rc/andromeda
  • mx-chain-testing-suite Target Branch: rc/andromeda

🚀 Environment Variables:

  • TIMESTAMP: 01042025-102704
  • PYTEST_EXIT_CODE: 0
    🎉 MultiversX CI/CD Workflow Complete!

@github-actions
Copy link

github-actions bot commented Apr 1, 2025

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: f2e694bb5262cd8d35b992c66b9ef51a4a7b6654
  • Current Branch: fix-bitmap
  • mx-chain-go Target Branch: rc/andromeda
  • mx-chain-simulator-go Target Branch: rc/andromeda
  • mx-chain-testing-suite Target Branch: rc/andromeda

🚀 Environment Variables:

  • TIMESTAMP: 01042025-105205
  • PYTEST_EXIT_CODE: 0
    🎉 MultiversX CI/CD Workflow Complete!

@github-actions
Copy link

github-actions bot commented Apr 1, 2025

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 3a76022a024f7f68c8405a255ea484f7848edbed
  • Current Branch: fix-bitmap
  • mx-chain-go Target Branch: rc/andromeda
  • mx-chain-simulator-go Target Branch: rc/andromeda
  • mx-chain-testing-suite Target Branch: rc/andromeda

🚀 Environment Variables:

  • TIMESTAMP: 01042025-120426
  • PYTEST_EXIT_CODE: 0
    🎉 MultiversX CI/CD Workflow Complete!

@miiu96 miiu96 changed the base branch from rc/andromeda to feat/andromeda-patch1 April 1, 2025 12:14
return result
}

func UnsetBitInBitmap(index int, bitmap []byte) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

Copy link
Contributor

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 addresses a bug fix in the bitmap generation and update logic used in block processing and associated testing. Key changes include:

  • Updating tests in processor_test.go to cover the UnsetBitInBitmap functionality.
  • Modifying the CreateNewBlock and updatePreviousProofAndAddonHeader flows in processor.go to invoke UnsetBitInBitmap for non-managed validators.
  • Adjusting configuration parameters and timing in chainSimulator.go and jail_test.go to better reflect the desired simulator behavior.

Reviewed Changes

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

File Description
node/chainSimulator/process/processor_test.go Added tests to check bitmap manipulation functions
node/chainSimulator/process/processor.go Updated bitmap handling in block creation and signature logic
node/chainSimulator/chainSimulator.go Changed consensus configuration and increased sleep duration
integrationTests/chainSimulator/staking/jail/jail_test.go Increased epoch transitions to simulate multi-epoch behavior
Comments suppressed due to low confidence (1)

node/chainSimulator/process/processor.go:317

  • [nitpick] Replacing header.GetPubKeysBitmap() with a hardcoded []byte{1} might not be intended; please verify that this change correctly reflects the intended signature behavior.
[]byte{1},

}

func UnsetBitInBitmap(index int, bitmap []byte) error {
if len(bitmap) < index/8 {
Copy link

Copilot AI Apr 1, 2025

Choose a reason for hiding this comment

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

The boundary check in UnsetBitInBitmap may be off by one; consider using 'if index/8 >= len(bitmap)' to correctly validate the bitmap length.

Suggested change
if len(bitmap) < index/8 {
if index/8 >= len(bitmap) {

Copilot uses AI. Check for mistakes.
}

func UnsetBitInBitmap(index int, bitmap []byte) error {
if len(bitmap) < index/8 {
Copy link
Contributor

Choose a reason for hiding this comment

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

if index%8 is not 0, i think expected bitmap size has to be higher

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


func UnsetBitInBitmap(index int, bitmap []byte) error {
if len(bitmap) < index/8 {
return errors.New("bitmap too short")
Copy link
Contributor

Choose a reason for hiding this comment

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

we already have ErrWrongSizeBitmap is errors/common

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

headerHash,
header.GetEpoch(),
header.GetPubKeysBitmap(),
[]byte{1},
Copy link
Contributor

Choose a reason for hiding this comment

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

is this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted

@github-actions
Copy link

github-actions bot commented Apr 1, 2025

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 3b59ea87a7a9af83e112f5b0033b353468677b1c
  • Current Branch: fix-bitmap
  • mx-chain-go Target Branch: rc/andromeda
  • mx-chain-simulator-go Target Branch: rc/andromeda
  • mx-chain-testing-suite Target Branch: rc/andromeda

🚀 Environment Variables:

  • TIMESTAMP: 01042025-125211
  • PYTEST_EXIT_CODE: 0
    🎉 MultiversX CI/CD Workflow Complete!

@sstanculeanu sstanculeanu merged commit 50b79e9 into feat/andromeda-patch1 Apr 1, 2025
4 checks passed
@sstanculeanu sstanculeanu deleted the fix-bitmap branch April 1, 2025 13:14
@github-actions
Copy link

github-actions bot commented Apr 1, 2025

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: b233971243ee83cf6f8aeb3e213787579799f53f
  • Current Branch: fix-bitmap
  • mx-chain-go Target Branch: rc/andromeda
  • mx-chain-simulator-go Target Branch: rc/andromeda
  • mx-chain-testing-suite Target Branch: rc/andromeda

🚀 Environment Variables:

  • TIMESTAMP: 01042025-134504
  • PYTEST_EXIT_CODE: 0
    🎉 MultiversX CI/CD Workflow Complete!

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.

4 participants