Skip to content

Clreceipt#27

Open
sidhujag wants to merge 10 commits intomasterfrom
clreceipt
Open

Clreceipt#27
sidhujag wants to merge 10 commits intomasterfrom
clreceipt

Conversation

@sidhujag
Copy link
Member

@sidhujag sidhujag commented Mar 4, 2026

  1. btc checkpoint precompiles
  2. bootstrap feature

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd5739b4b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if err != nil {
return err
}
if err := os.RemoveAll(chaindataPath); err != nil {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Delay chaindata deletion until bootstrap install is guaranteed

The install flow deletes the existing chaindata directory before attempting moveOrCopyDir, so a failed copy/rename (for example, cross-device copy failing due to disk full or I/O error) leaves the node with neither the old state nor a complete new state. This is especially dangerous when --syscoin.statebootstrap.force is used on a live datadir, because a transient install failure becomes destructive data loss.

Useful? React with 👍 / 👎.

hc.BTCCheckpointIndexCache.Add(btcHash, existingIdx)
return
}
hc.BTCCheckpointLastIndex++

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard BTCCheckpointLastIndex with synchronization

BTCCheckpointLastIndex is mutated in write/delete paths and read in query paths without any mutex/atomic protection, so concurrent block ingestion and RPC/VM reads can race on this shared field. In practice, precompile calls can observe inconsistent values (and on 32-bit builds, torn 64-bit reads are possible), so this counter should be guarded with synchronization similar to other shared chain state.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant