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

Save our own broadcast message directly and save raw gossip message from peers to memory first #434

Merged
merged 18 commits into from
Jan 7, 2025

Conversation

contrun
Copy link
Collaborator

@contrun contrun commented Jan 2, 2025

While verifying gossip messages, the first thing we need to do is to obtain the ChannelAnnouncement timestamp. This operation requires interaction with the CKB chain. As an implementation detail, we need to obtain the whole transaction for the timestamp in the block header. So it is possible that we will call the chain actor a few times in order to process the gossip message. This PR attempts to cache the ChannelAnnouncement timestamp and the channel transaction in memory to reduce the interaction with the CKB chain. It also fixes the two problems in the comment of #414

@contrun contrun requested a review from quake January 2, 2025 05:26
@contrun contrun force-pushed the cache-chain-actor-results branch from a12f301 to 048d740 Compare January 2, 2025 05:28
src/fiber/gossip.rs Outdated Show resolved Hide resolved
@contrun contrun force-pushed the cache-chain-actor-results branch 3 times, most recently from d58843a to 7f72010 Compare January 3, 2025 06:33
@contrun contrun force-pushed the cache-chain-actor-results branch from 7f72010 to 3b371bc Compare January 3, 2025 06:43
@contrun contrun changed the title Cache chain actor results while verifying gossip messages Obtaining on chain info before saving gossip message to memory Jan 3, 2025
@contrun contrun force-pushed the cache-chain-actor-results branch from c859164 to 5649b07 Compare January 6, 2025 04:07
@contrun contrun force-pushed the cache-chain-actor-results branch from cf6cca4 to a82e613 Compare January 6, 2025 04:15
@contrun contrun changed the title Obtaining on chain info before saving gossip message to memory Save our own broadcast message directly and save raw gossip message from peers to memory first Jan 6, 2025
@contrun contrun force-pushed the cache-chain-actor-results branch from 93bdbb5 to 17d4a19 Compare January 6, 2025 06:00
@contrun contrun force-pushed the cache-chain-actor-results branch from d63f40c to c046a60 Compare January 6, 2025 09:25
src/fiber/network.rs Outdated Show resolved Hide resolved
src/ckb/actor.rs Outdated Show resolved Hide resolved
@quake quake merged commit b972450 into nervosnetwork:develop Jan 7, 2025
18 checks passed
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.

2 participants