Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX(Archive.Processor): ensure add_block_aux is always adding block d…#18091

Closed
glyh wants to merge 2 commits into
compatiblefrom
lyh/fix/archive-race-condition
Closed

FIX(Archive.Processor): ensure add_block_aux is always adding block d…#18091
glyh wants to merge 2 commits into
compatiblefrom
lyh/fix/archive-race-condition

Conversation

@glyh
Copy link
Copy Markdown
Member

@glyh glyh commented Nov 11, 2025

…ata in 1 single txn

@glyh glyh requested a review from a team as a code owner November 11, 2025 04:11
@glyh
Copy link
Copy Markdown
Member Author

glyh commented Nov 11, 2025

!ci-nightly-me

@glyh glyh force-pushed the lyh/fix/archive-race-condition branch from e638b28 to ab6f53a Compare November 11, 2025 04:14
@glyh
Copy link
Copy Markdown
Member Author

glyh commented Nov 11, 2025

!ci-nightly-me

@glyh
Copy link
Copy Markdown
Member Author

glyh commented Nov 11, 2025

add_block_aux ~logger ?retries ~pool ~delete_older_than
~add_block:
(Block.add_from_precomputed ~logger ~proof_cache_db ~constraint_constants)
(Block.add_from_precomputed ~logger ~proof_cache_db ~constraint_constants
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The ugliness here comes from the fact add_block_aux is used for 3 different case making this interface hard to change.

in
(* NOTE: it's fine for accounts_accessed to be added non-atomically.
Since we're bootstrapping, I guess? *)
(* TODO: figure out whether we need to add genesis accounts to accounts_created *)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually this is interesting also from HF. If we have data from before hf and maybe from the start of blockchain then we have full history of all accounts.

However if we are starting archive from latest hf, we don't . So this could be a nice way to fill those gaps.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That sounds good, but I assume it should go into another PR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This one is a curious thing. In practice, I think it's fine to have ~accounts_accessed:[] ~accounts_created:[]. I can't imagine (as of now) a flow where we'd be creating some accounts in a HF.

In theory the code allows that, but in practice this won't ever be happening.

@dkijania
Copy link
Copy Markdown
Member

@glyh Is this change covered with unit/functional tests ? To truly verify fix i would imagine we write reproduction unit test which is failing on this special case we are fixing in your PR. Then we ensures that this implementation fixes mentioned test. Otherwise, we are a bit wandering in the dark.

@glyh
Copy link
Copy Markdown
Member Author

glyh commented Nov 11, 2025

This bug is a race condition, we need to think of a proper way add test.

@glyh glyh mentioned this pull request Nov 11, 2025
in
(* NOTE: it's fine for accounts_accessed to be added non-atomically.
Since we're bootstrapping, I guess? *)
(* TODO: figure out whether we need to add genesis accounts to accounts_created *)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This one is a curious thing. In practice, I think it's fine to have ~accounts_accessed:[] ~accounts_created:[]. I can't imagine (as of now) a flow where we'd be creating some accounts in a HF.

In theory the code allows that, but in practice this won't ever be happening.

@glyh
Copy link
Copy Markdown
Member Author

glyh commented Nov 16, 2025

Is it okay to merge, now George has implemented tests? @dkijania

@glyh
Copy link
Copy Markdown
Member Author

glyh commented Nov 17, 2025

!ci-build-me

@glyh
Copy link
Copy Markdown
Member Author

glyh commented Nov 18, 2025

!ci-build-me

@glyh
Copy link
Copy Markdown
Member Author

glyh commented Nov 18, 2025

Close in favor of #18132

@glyh glyh closed this Nov 18, 2025
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.

3 participants