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

zetacore : clean up finalized cctxs #2781

Open
Tracked by #350
kingpinXD opened this issue Aug 28, 2024 · 3 comments
Open
Tracked by #350

zetacore : clean up finalized cctxs #2781

kingpinXD opened this issue Aug 28, 2024 · 3 comments
Labels
m:crosschain zetacore Issues related to ZetaCore

Comments

@kingpinXD
Copy link
Contributor

Finalized CCTX can exist in three states
OutboundMined : Can be removed
Reverted : can be removed
Aborted : we support refunding a aborted TX , these should not be removed

Considering the above information, we should remove CCTXs finalized from our state.

We keep track of finalized inbounds separately, so this would not affect the security of the system, making sure already processed cctxs cannot be submitted again.
https://github.com/zeta-chain/zeta-node/blob/c3d19297b4d345e9d7ff746f510a0e3e25eb6355/x/crosschain/keeper/msg_server_vote_inbound_tx.go#L121-L124

@kingpinXD kingpinXD added zetacore Issues related to ZetaCore m:crosschain labels Aug 28, 2024
@kingpinXD kingpinXD changed the title zetacore : clean up finalazied cctxs zetacore : clean up finalized cctxs Aug 28, 2024
@gartnera
Copy link
Member

We'd need to keep them around long enough for the indexer to see them though right?

@lumtis
Copy link
Member

lumtis commented Aug 29, 2024

Not sure about this one tbh. CCTXs are the pillar of ZetaChain, would make sense to me to keep indexed and keep a tamperproof and uncensorable way to fetch these through node even if it brings more overhead on state.

Cleaning ballots are different for example, as used more internally in the protocol.

@kingpinXD
Copy link
Contributor Author

If we just need the information regarding the cctx , we can add as much as we need to an event which is stored as part of the tx result. @gartnera We can use the events for indexing as as well.

Keeping long-lived data as part of events might be beneficial because some nodes can choose not to store it by just setting tx_index to null , or even setting it to psql for richer searching.
Keeping it in application storage mandates every node to store it.

With that said , the CCTX data does not seem to be an immediate concern , and can be added to the backlog for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
m:crosschain zetacore Issues related to ZetaCore
Projects
None yet
Development

No branches or pull requests

3 participants