(
#[allow(unused)] context: &ContextCell<R>,
deposit_request: &DepositRequest,
state: &ConsensusState,
protocol_version_digest: Digest,
#[allow(unused)] new_height: u64,
valida
| 1919 | fn height_notify_executed(&mut self, height: u64, block_digest: Digest) { |
| 1920 | // Notify only waiters for this specific (height, digest) pair |
| 1921 | if let Some(senders) = self.pending_height_notifys.remove(&(height, block_digest)) { |
| 1922 | for sender in senders { |
| 1923 | let _ = sender.send(true); // Ignore if receiver dropped |
| 1924 | } |
| 1925 | } |
| 1926 | } |
| 1927 | |
| 1928 | fn height_notify_finalized_up_to(&mut self, height: u64, block_digest: Digest) { |
| 1929 | let pending = std::mem::take(&mut self.pending_height_notifys); |
| 1930 | |
| 1931 | for ((waiter_height, waiter_digest), senders) in pending { |
| 1932 | if waiter_height > height { |
| 1933 | self.pending_height_notifys |
| 1934 | .insert((waiter_height, waiter_digest), senders); |
| 1935 | continue; |
| 1936 | } |
| 1937 | |
| 1938 | let block_executed = waiter_height == height && waiter_digest == block_digest; |
| 1939 | for sender in senders { |
| 1940 | let _ = sender.send(block_executed); // Ignore if receiver dropped |
| 1941 | } |
| 1942 | } |
| 1943 | } |
| 1944 | |
| 1945 | async fn handle_aux_data_mailbox( |
| 1946 | &mut self, |
| 1947 | height: u64, |
| 1948 | parent_digest: Digest, |
| 1949 | sender: oneshot::Sender<Option<BlockAuxData>>, |
| 1950 | ) { |
| 1951 | // We're building a block at `height`, so we need state from parent at `height - 1` |
| 1952 | let parent_height = height - 1; |
| 1953 | |
| 1954 | // Look up the specific parent block's state |
| 1955 | let state = if let Some(fork_state) = self |
| 1956 | .fork_states |
| 1957 | .get(&parent_height) |
| 1958 | .and_then(|forks| forks.get(&parent_digest)) |
| 1959 | { |
| 1960 | &fork_state.consensus_state |
| 1961 | } else if parent_height == self.canonical_state.get_latest_height() |
| 1962 | && parent_digest == self.canonical_state.get_head_digest() |
| 1963 | { |
| 1964 | // If not in forks, check if the height and digest match those of the canonical chain |
| 1965 | &self.canonical_state |
| 1966 | } else { |
| 1967 | warn!( |
| 1968 | "Aborted aux data request with parent height {} and parent digest {} for block that doesn't connect to any forks or the canonical chain. Canonical height {} and head digest {}", |
| 1969 | parent_height, |
| 1970 | parent_digest, |
| 1971 | self.canonical_state.get_latest_height(), |
| 1972 | self.canonical_state.get_head_digest(), |
| 1973 | ); |
| 1974 | let _ = sender.send(None); |
| 1975 | return; |
| 1976 | }; |
| 1977 | |
| 1978 | let treasury_address = state.get_treasury_address(); |
no test coverage detected