-
Notifications
You must be signed in to change notification settings - Fork 13
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
MTG-750 Calculating bubblegum and account checksums #291
Conversation
0c84d5c
to
ba9fa93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Only one small question at the moment
hasher = Hasher::default(); | ||
} | ||
hasher.hash(&k); | ||
hasher.hash(&v); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we save value as well? Why not only key or value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@n00m4d
I assume that theoretically (not sure how high the probability is) we might have a situation, when on different peers there are bubblegum changes with same pubkey+slot+seq, but different signatures.
It you believe that this is impossible, then I can remove the signature from the bubblegum change entity (and from the hashing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, not sure either. Ok let's leave it for now 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and also while was looking at fork cleaner got a thought that maybe we should sync with sequence consistency checker before calculating epoch hash, not to calculate epoch hash if we have gaps in tree sequences.
f3636c6
to
b504cad
Compare
b504cad
to
23cb90a
Compare
7cd234a
to
8595abb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still have some reading to do, but sharing the feedback as some comments are pending for quite a while
@@ -185,6 +188,14 @@ pub async fn main() -> Result<(), IngesterError> { | |||
} | |||
|
|||
let rpc_client = Arc::new(RpcClient::new(config.rpc_host.clone())); | |||
let (nft_change_snd, nft_change_rcv) = mpsc::channel(NTF_CHANGES_NOTIFICATION_QUEUE_SIZE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment: Manages event related to epochs changes and notifications (new epoch started, late data - epoch invalidation). Producers are processors (bubblegum and account), consumer - consistency calculator.
pub fn track_slot_counter(slot: u64) -> u64 { | ||
let prev = LAST_SLOT.load(std::sync::atomic::Ordering::Relaxed); | ||
if slot > prev { | ||
LAST_SLOT.store(slot, std::sync::atomic::Ordering::Relaxed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code does not guaranteed to store the top slot processed, rather one of the top slots. Please add a comment
checksum: Checksum::Calculating, | ||
}; | ||
|
||
pub const ACC_BUCKET_INVALIDATE: AccountNftBucket = AccountNftBucket { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub const ACC_BUCKET_INVALIDATE: AccountNftBucket = AccountNftBucket { | |
pub const ACC_BUCKET_INVALIDATED: AccountNftBucket = AccountNftBucket { |
checksum: Checksum::Invalidated, | ||
}; | ||
|
||
pub const ACC_GRAND_BUCKET_INVALIDATE: AccountNftGrandBucket = AccountNftGrandBucket { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub const ACC_GRAND_BUCKET_INVALIDATE: AccountNftGrandBucket = AccountNftGrandBucket { | |
pub const ACC_GRAND_BUCKET_INVALIDATED: AccountNftGrandBucket = AccountNftGrandBucket { |
}); | ||
if await_operation { | ||
let _ = task | ||
.await |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the tasked be always called if we don't await it?
NftChangesTracker { sender } | ||
} | ||
|
||
/// Persists given account NFT change into the sotrage, and, if the change is from the epoch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Persists given account NFT change into the sotrage, and, if the change is from the epoch | |
/// Persists given account NFT change into the storage, and, if the change is from the epoch |
See: #316