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

Fixed withdrawal accounts not being in the state trie #18

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

BGluth
Copy link
Member

@BGluth BGluth commented Feb 1, 2024

Just thought I would get your eyes on this one while I test it. Now includes the accounts involved with withdrawals in the dummy IR.

@BGluth BGluth requested a review from Nashtare February 1, 2024 18:32
@BGluth BGluth merged commit f285495 into john_temp_fix_branch Feb 1, 2024
2 checks passed
@BGluth BGluth deleted the john_extra_temp_fix_branch branch February 1, 2024 19:24
@@ -350,12 +354,26 @@ impl ProcessedBlockTrace {
let txn_idx_of_dummy_entry =
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I think this is actually never used and could be removed at some point.

Comment on lines +357 to +358
// To avoid double hashing the addrs, but I don't know if the extra `Vec`
// allocation is worth it.
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is fine as is for now (we're definitely not in a hot spot anyway here). But there are a few allocations across the lib that could be alleviated I think, so worth keeping track of, I'll open a ticket.

Comment on lines +545 to +548
fn create_dummy_proof_trie_inputs(
final_trie_state: &PartialTrieState,
state_trie: HashedPartialTrie,
) -> TrieInputs {
Copy link
Contributor

Choose a reason for hiding this comment

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

The namings here aren't straightforward. We need a massive documentation effort anyway across the decoder (proof-gen documentation is somehow acceptable now). But to not increase complexity once we merge this branch fix to main I'd suggest documenting the newest changes for clarity.

@@ -350,12 +354,26 @@ impl ProcessedBlockTrace {
let txn_idx_of_dummy_entry =
txn_ir.last().unwrap().txn_number_before.low_u64() as usize + 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we guaranteed that txn_ir is never empty? And why wouldn't txn_ir.last()?.txn_number_before.low_u64() work?

Comment on lines +357 to +358
// To avoid double hashing the addrs, but I don't know if the extra `Vec`
// allocation is worth it.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment should probably be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

As there are a few places where the allocations may be removed, I think it could be preferable to keep this "for now", and remove it during the. Allocations PR, whether we find a concrete answer to this section or not. Or at least turn it as a todo


impl TxnMetaState {
fn txn_bytes(&self) -> Vec<u8> {
match self.txn_bytes.as_ref() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the as_ref() really needed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah in this case we need it if we want to have &self instead of self. We could also do &self.txn_bytes.

@BGluth
Copy link
Member Author

BGluth commented Feb 2, 2024

Hey since I accidentally merged this PR a bit early, I'll open up a second PR later today for some cleanup (including the comments here).

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