Skip to content

OffersMessageHandler impl for ChannelManager accesses time #3097

Closed

Description

@TheBlueMatt

We have users who can't access time due to being in WASM, and while we'd like to move them to no-std, we can't do that until we get to rust-bitcoin 0.32. Thus, for our next release, we either need to upgrade to rust-bitcoin 0.32 or we need to drop the time accesses in the OffersMessageHandler impl.

Activity

  1. added this to the 0.0.124 milestone on Jun 5, 2024
  2. jkczyz commented on Jun 5, 2024

    @jkczyz
    Contributor

    Note that timer_tick_occurred is also affected for removing stale payments (i.e., stuck AwaitingInvoice).

    #[cfg(feature = "std")]
    let duration_since_epoch = std::time::SystemTime::now()
    .duration_since(std::time::SystemTime::UNIX_EPOCH)
    .expect("SystemTime::now() should come after SystemTime::UNIX_EPOCH");
    #[cfg(not(feature = "std"))]
    let duration_since_epoch = Duration::from_secs(
    self.highest_seen_timestamp.load(Ordering::Acquire).saturating_sub(7200) as u64
    );
    self.pending_outbound_payments.remove_stale_payments(
    duration_since_epoch, &self.pending_events
    );

  3. TheBlueMatt commented on Jul 11, 2024

    @TheBlueMatt
    CollaboratorAuthor

    We can avoid having to fix this issue if we do #3100 and uncouple the LDK no-std feature from rust-bitcoin no-std.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions