Giter VIP home page Giter VIP logo

Comments (2)

lehins avatar lehins commented on July 23, 2024

Turns out there is a subtle bug, since the counter should not have been incremented when there is at least one proposal to vote on. Here is the issue #4347

That being said, the counter will be incremented when there are no proposals. The interesting fact is that we do not increment a value for every DRep, we have a separate counter incremented for all DReps, regardless if they have expired or not. That does not mean though that we cannot implement this feature on the ledger query side here:

queryDRepState nes creds
| null creds = drepsState
| otherwise =
drepsState `Map.restrictKeys` creds
& if numDormantEpochs == EpochNo 0
then id
else (<&> drepExpiryL %~ binOpEpochNo (+) numDormantEpochs)
where
drepsState = vsDReps $ certVState $ lsCertState $ esLState $ nesEs nes
numDormantEpochs = vsNumDormantEpochs $ certVState $ lsCertState $ esLState $ nesEs nes

All we need to do is do not change the drepExpiry for those DReps that have already expired, which can all be done on this line:

else (<&> drepExpiryL %~ binOpEpochNo (+) numDormantEpochs)

We should also add a test for this functionality in the cardano-ledger-api test suite for this.

from cardano-ledger.

lehins avatar lehins commented on July 23, 2024

Fixed in #4358

from cardano-ledger.

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.