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

Invalid gindex calculation #311

Open
wemeetagain opened this issue Mar 9, 2023 · 2 comments
Open

Invalid gindex calculation #311

wemeetagain opened this issue Mar 9, 2023 · 2 comments

Comments

@wemeetagain
Copy link
Member

Describe the bug

import {ssz} from "@lodestar/types";

const {BeaconState} = ssz.phase0;
console.log(
  BeaconState.getPathInfo(["validators", 0, "activationEpoch"]).gindex === BeaconState.getPathInfo(["validators", 0, "pubkey"]).gindex
);
// true

Expected behavior

false

@ratankaliani
Copy link

Currently running into this - how do I calculate the gindices of these fields manually?

Trying to generate a merkle proof of these fields, but can't do so if the gindices are the same for the Validator container, as well as all of the fields within it.

ratankaliani added a commit to succinctlabs/telepathy-contracts that referenced this issue May 3, 2023
# Changes
- Add a `DivaBeaconOracle` contract where you can prove:
- Any of the fields of a
[validator](https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator)
- The `balance` of a validator using the `balances` container in
`BeaconState`
- A deposit from a BLSPubkey using the `deposits` container in
`BeaconBlock`

# Notes
Lodestar currently has a [gindex
issue](ChainSafe/ssz#311) for fields in the
`Validator` container. As such, we need to calculate the gindices of
`Validator` fields manually.
soulstar9792 pushed a commit to Tant97055/telepathy-contracts that referenced this issue Sep 30, 2024
# Changes
- Add a `DivaBeaconOracle` contract where you can prove:
- Any of the fields of a
[validator](https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator)
- The `balance` of a validator using the `balances` container in
`BeaconState`
- A deposit from a BLSPubkey using the `deposits` container in
`BeaconBlock`

# Notes
Lodestar currently has a [gindex
issue](ChainSafe/ssz#311) for fields in the
`Validator` container. As such, we need to calculate the gindices of
`Validator` fields manually.
@philknows
Copy link
Member

Related to #328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants