Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

operation_history_object::virtual_op numbering may be discontinuous (possibly with holes) #2692

Open
2 of 17 tasks
abitmore opened this issue Nov 21, 2022 · 0 comments
Open
2 of 17 tasks

Comments

@abitmore
Copy link
Member

Bug Description

In database::push_applied_operation(), after _current_virtual_op is assigned to virtual_op of the newly created operation_history_object, _current_virtual_op++ is called:

uint32_t database::push_applied_operation( const operation& op )
{
_applied_ops.emplace_back(op);
operation_history_object& oh = *(_applied_ops.back());
oh.block_num = _current_block_num;
oh.trx_in_block = _current_trx_in_block;
oh.op_in_trx = _current_op_in_trx;
oh.virtual_op = _current_virtual_op++;
return _applied_ops.size() - 1;
}

If the operation being pushed is in a proposal, after it is added to _applied_ops, it may be removed later if the proposal fails, but _current_virtual_op is not updated back:

else
{
_applied_ops.resize( old_applied_ops_size );
}

I'm not sure if it is worth fixing.

#1675 is related.

Impacts
Describe which portion(s) of BitShares Core may be impacted by this bug. Please tick at least one box.

  • API (the application programming interface)
  • Build (the build process or something prior to compiled code)
  • CLI (the command line wallet)
  • Deployment (the deployment process after building such as Docker, Travis, etc.)
  • DEX (the Decentralized EXchange, market engine, etc.)
  • P2P (the peer-to-peer network for transaction/block propagation)
  • Performance (system or user efficiency, etc.)
  • Protocol (the blockchain logic, consensus, validation, etc.)
  • Security (the security of system or user data, etc.)
  • UX (the User Experience)
  • Other (please add below)

Host Environment
Please provide details about the host environment. Much of this information can be found running: witness_node --version.

  • BitShares Version: 6.0.2

CORE TEAM TASK LIST

  • Evaluate / Prioritize Bug Report
  • Refine User Stories / Requirements
  • Define Test Cases
  • Design / Develop Solution
  • Perform QA/Testing
  • Update Documentation
@abitmore abitmore added this to the Future Feature Release milestone Nov 21, 2022
@abitmore abitmore added this to New -Awaiting Core Team Evaluation in Project Backlog via automation Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Project Backlog
  
New -Awaiting Core Team Evaluation
Development

No branches or pull requests

1 participant