8000 At Record Stage, it seems there is possibility about not hashing when tick event. · Issue #407 · solana-labs/solana · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
At Record Stage, it seems there is possibility about not hashing when tick event. #407
Closed
@JhChoy

Description

@JhChoy

Please correct me if I'm wrong.
At record_stage.rs :: fn try_process_signals,
if let Some(entry) = recorder.tick(start_time, tick_duration) { sender.send(entry).or(Err(()))?; }

recorder.rs :: fn tick, it returns
Some(self.record(vec![]))

and at fn record
Entry::new_mut(&mut self.last_hash, &mut self.num_hashes, transactions)

goes to Entry:: fn new_mut,
let entry = Self::new(start_hash, *cur_hashes, transactions);
and reset num_hashes and start_hash
*start_hash = entry.id; *cur_hashes = 0;

At fn new, it calls next_hash and there,

if !hash_data.is_empty() {
        extend_and_hash(&id, &hash_data)
    } else if num_hashes != 0 {
        hash(&id)
    } else {
        id
    }

hash(&id) looks like to use for hashing tick event b/c tick event doesn't have data, just num_hashes.
However, when if tick event occurs just after recording entry with txs, tick event will have 0 num_hashes because it always resets after calling Entry::new_mut. Therefore, tick event couldn't be hashed.
I want you to let me know if I'm mistaken or if this is a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAdd this to close an issue with instructions on how to repost as a question on Stack Exchange

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0