Code Monkey home page Code Monkey logo

Comments (2)

lafont-e avatar lafont-e commented on September 17, 2024

I'm reviewing this issue and I need a little help, I don't fully understand the code.

From what I see, the checksum is a merkle tree of all records in buckets BlockPath, CoinOutputs, BlockStakeOutputs, and buckets prefixed dco_ and fcex_.

The comparison is done between the checksum at the time the parent block was added and the parent block as it is now, but don't understand why the parent is forked from the consensus as the parent is already in the consensus. Maybe just removing the current should be enough ?

I understand that CoinOutputs may have changed, as current block has been processed but the fork only reverts blocks, nothing more, so CoinOutputs does not seem to reflect the changes done forking the consensus as the block spending may not be equal between parent and current. Same for BlockStakeOutputs.

Should it be a possible solution to revert Coins and BlockStake to its original position before doing the consensuschecksum ?

Or, as doing a consensuschecksum now is a very costly operation (reading all records from at least 3 buckets) calculated for every new block added and sometimes (every 1000 blocks randomly) and it will be costlier when this thing is 20 years running, maybe we should think on another cheaper way to guarantee the consistency of the consensus

Should the consensusChecksum be changed for a checking of only BlockPath, as from what I understand, CoinOutputs and BlockStakeOutputs are derived from the blocks on BlockPath and verifiable just reading the BlockPath.

Not sure everything I've written make any sense, but any light about this that may help me solve this issue is greatly appreciated.

from rivine.

LeeSmet avatar LeeSmet commented on September 17, 2024

Still present. The problem is that whenever a block is applied, there is also some "maintenance". This is mainly the addition of the delayed outputs to the consensus set, and removing the delayed bucket. But when the block is reverted, there seems to be no such action which restores the delayed bucket. As a result, the consensus set id (which also takes the values from these buckets) is wrong

from rivine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.