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

account_hash_ignore_slot behaves incorrectly at genesis #32800

Closed
ripatel-fd opened this issue Aug 11, 2023 · 5 comments · Fixed by #33692
Closed

account_hash_ignore_slot behaves incorrectly at genesis #32800

ripatel-fd opened this issue Aug 11, 2023 · 5 comments · Fixed by #33692
Assignees

Comments

@ripatel-fd
Copy link
Contributor

ripatel-fd commented Aug 11, 2023

Problem

Feature account_hash_ignore_slot removes the slot field from the BLAKE3 accounts hash.
On Solana Labs v1.17 test ledgers, this feature is activated by default (meaning there is a genesis account for the sysvar).

At slot 0, the bank's accounts delta hash is constructed from the hashes of all genesis accounts.

But even though this feature is active at the genesis slot, it uses the old method (before feature activation) to compute the genesis account hashes.

Proposed Solution

  • Make sure features are activated before computing the account hash.
  • Extend unit tests to cover genesis too.
@ripatel-fd
Copy link
Contributor Author

Discussed this with @jeffwashington -- Since this has no impact on devnet, testnet, or mainnet, no immediate action required. It only affects new clusters, but is only a cosmetic issue. Resolving this would probably require large changes to ledger bootstrapping. Thus, the best way forward is to declare this behavior "correct" :)

Once the feature gate is activated, and the legacy behavior is removed, this will automatically fix itself.

@ripatel-fd
Copy link
Contributor Author

@jeffwashington On further investigation, the problem goes deeper: Both hash versions are shared in the genesis slots. I'm not sure whether it's deterministic, but the pattern seems to be the following: Native programs and sysvars use the new hash version, and features use the old hash version. I'll report if I can match this behavior in Firedancer.

@ripatel-fd
Copy link
Contributor Author

OK, pretty sure it's non-deterministic. I'll try to fix this upstream.

ripatel-fd pushed a commit to firedancer-io/solana that referenced this issue Aug 11, 2023
ripatel-fd pushed a commit to firedancer-io/firedancer-testbins that referenced this issue Aug 11, 2023
jumpsiegel pushed a commit to firedancer-io/solana that referenced this issue Oct 12, 2023
@ripatel-fd
Copy link
Contributor Author

ripatel-fd commented Oct 13, 2023

@t-nelson Could someone from the Labs team revisit this? Without this fix #32801 Solana Labs v1.16 cannot replay its own test ledgers. This makes it impossible to do any sort of cross-client work. (One of the reasons we are maintaining a long-term fork of Labs for Firedancer development)

@jeffwashington
Copy link
Contributor

fyi #33692
@t-nelson , @ripatel-fd
I can manage this pr once we figure out it is right.

jumpsiegel pushed a commit to firedancer-io/solana that referenced this issue Oct 17, 2023
jumpsiegel pushed a commit to firedancer-io/solana that referenced this issue Nov 3, 2023
jumpsiegel pushed a commit to firedancer-io/solana that referenced this issue Nov 16, 2023
jumpsiegel pushed a commit to firedancer-io/solana that referenced this issue Nov 28, 2023
jumpsiegel pushed a commit to firedancer-io/solana that referenced this issue Dec 1, 2023
jumpsiegel pushed a commit to firedancer-io/solana that referenced this issue Dec 1, 2023
Fixes solana-labs#32800

rebase

debug-master: save this

bincode helper, empty for error case

debug-master: lock down public keys

debug-master: save this

base64

fix invoke context

update bash scripts

add json printer

remove single threads

debug-master: add printer

debug-master: hashes

debug-master: new logging

debug-master: save stuff away

debug-master: save core

debug-master: save updates

debug-master: dump per slot

Fix build
jumpsiegel pushed a commit to firedancer-io/solana that referenced this issue Dec 14, 2023
Fixes solana-labs#32800

rebase

debug-master: save this

bincode helper, empty for error case

debug-master: lock down public keys

debug-master: save this

base64

fix invoke context

update bash scripts

add json printer

remove single threads

debug-master: add printer

debug-master: hashes

debug-master: new logging

debug-master: save stuff away

debug-master: save core

debug-master: save updates

debug-master: dump per slot

Fix build
jumpsiegel pushed a commit to firedancer-io/solana that referenced this issue Dec 20, 2023
Fixes solana-labs#32800

rebase

debug-master: save this

bincode helper, empty for error case

debug-master: lock down public keys

debug-master: save this

base64

fix invoke context

update bash scripts

add json printer

remove single threads

debug-master: add printer

debug-master: hashes

debug-master: new logging

debug-master: save stuff away

debug-master: save core

debug-master: save updates

debug-master: dump per slot

Fix build
jumpsiegel pushed a commit to firedancer-io/solana that referenced this issue Mar 11, 2024
Fixes solana-labs#32800

rebase

debug-master: save this

bincode helper, empty for error case

debug-master: lock down public keys

debug-master: save this

base64

fix invoke context

update bash scripts

add json printer

remove single threads

debug-master: add printer

debug-master: hashes

debug-master: new logging

debug-master: save stuff away

debug-master: save core

debug-master: save updates

debug-master: dump per slot

Fix build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants