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

Serialize ProtocolVersions to storage #2506

Closed
drcpu-github opened this issue Nov 4, 2024 · 5 comments
Closed

Serialize ProtocolVersions to storage #2506

drcpu-github opened this issue Nov 4, 2024 · 5 comments
Labels

Comments

@drcpu-github
Copy link
Collaborator

At the moment whenever a protocol version is registered, its attributes are stored in a hashmap, but whenever a node is restarted it is not aware of these attributes anymore. Therefore the node assumes it is still in V1.7 after a restart, even though TAPI voted in V1.8 or the required stake amount for V2.0 was met, resulting in blocks etc not validating properly anymore.

@aesedepece
Copy link
Member

This might do it, but haven't tried it yet:
aa2670d

Essentially, it puts the protocol info into the chain state, and makes sure it is read and written in the (allegedly) right places.

@aesedepece
Copy link
Member

aesedepece commented Nov 10, 2024

I'm not sure if 1_8 needs its own thing like this of 2_0, or the TAPI will be enough:

// Register the 2_0 protocol into chain state (namely, chain info) so that
// the scheduled activation data eventually gets persisted into storage.
chain_info.protocol.register(
block_epoch + activation_delay,
ProtocolVersion::V2_0,
checkpoint_period,
);

@drcpu-github
Copy link
Collaborator Author

I'm pretty sure it needs its own thing like this because TAPI is never persisted into storage either. AFAIK, if you restart your node during V1_8 (after all TAPI blocks have been confirmed and persisted into storage), it will forget it is in V1_8. I'll test it though.

@drcpu-github
Copy link
Collaborator Author

Added V1_8 into chain_info too for above reason: #2515

@aesedepece
Copy link
Member

Done in aa2670d + ded83bb

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

No branches or pull requests

2 participants