Git Product home page Git Product logo

Comments (5)

HiroyukiNaito avatar HiroyukiNaito commented on August 16, 2024 1

@ensi321 Thank you for describing the technical context of this.
So, I try to crop the codes and functionalize them, and apply the 2 points you suggested.

from lodestar.

HiroyukiNaito avatar HiroyukiNaito commented on August 16, 2024

I pick the issue as a good first issue.

from lodestar.

HiroyukiNaito avatar HiroyukiNaito commented on August 16, 2024

I'm locating where should I change.

Should we move this into a function somewhere and be re-used in gossip + here + state transition? In a way to signal that this logic must be consistent between those three places

Is this right place?
https://github.com/ChainSafe/lodestar/blob/unstable/packages/beacon-node/src/chain/validation/attestation.ts#L478

from lodestar.

HiroyukiNaito avatar HiroyukiNaito commented on August 16, 2024

Shamely, I could not find where should I change the state-transition code.
Do you mind if you give me some hints?

from lodestar.

ensi321 avatar ensi321 commented on August 16, 2024

@HiroyukiNaito Hey! Thanks for picking this up.

Just want to share some background about this issue. Feel free to skip to tldr.

The related change is for implementing Deneb EIP EIP-7045, which is to extend the admissible range of attestation from [n - 32, n] slots to [(Math.floor(n / 32) - 1) * 32, n] slots. You can check out our implementation #5731 and also the consensus spec here.

The attestation validation logic in p2p we want to refactoring in Lodestar is to limit to lower bound of the slot in attestation by calculating earliestPermissableSlot. However, during state-transition, specifically during process_attestation, there is already an assertion in the spec and lodestar to limit the attestation to be within current or previous epoch, which has the same effect as setting lower (and upper) bound of the attestation slot. Therefore, the attestation validation logic in p2p is not needed in state-transition.

Shamely, I could not find where should I change the state-transition code.
Do you mind if you give me some hints?

tldr; The original comment is not quite accurate about state-transition. No refactoring needs to be made for state-transition. Only beacon_aggregate_and_proof and beacon_attestation_{subnet_id}

Is this right place?
https://github.com/ChainSafe/lodestar/blob/unstable/packages/beacon-node/src/chain/validation/attestation.ts#L478

Yes. Should be a straightforward change. Let me know if you have further questions

from lodestar.

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.