pub struct ChannelActorData {Show 44 fields
pub state: ChannelState,
pub public_channel_info: Option<PublicChannelInfo>,
pub local_tlc_info: ChannelTlcInfo,
pub remote_tlc_info: Option<ChannelTlcInfo>,
pub local_pubkey: Pubkey,
pub remote_pubkey: Pubkey,
pub id: Hash256,
pub funding_tx: Option<Transaction>,
pub funding_tx_confirmed_at: Option<(H256, u32, u64)>,
pub funding_udt_type_script: Option<Script>,
pub is_acceptor: bool,
pub is_one_way: bool,
pub to_local_amount: u128,
pub to_remote_amount: u128,
pub local_reserved_ckb_amount: u64,
pub remote_reserved_ckb_amount: u64,
pub commitment_fee_rate: u64,
pub commitment_delay_epoch: u64,
pub funding_fee_rate: u64,
pub signer: InMemorySigner,
pub local_channel_public_keys: ChannelBasePublicKeys,
pub commitment_numbers: CommitmentNumbers,
pub local_constraints: ChannelConstraints,
pub remote_constraints: ChannelConstraints,
pub tlc_state: TlcState,
pub retryable_tlc_operations: VecDeque<RetryableTlcOperation>,
pub waiting_forward_tlc_tasks: HashMap<TLCId, [u8; 32]>,
pub remote_shutdown_script: Option<Script>,
pub local_shutdown_script: Script,
pub last_committed_remote_nonce: Option<PubNonce>,
pub remote_revocation_nonce_for_verify: Option<PubNonce>,
pub remote_revocation_nonce_for_send: Option<PubNonce>,
pub remote_revocation_nonce_for_next: Option<PubNonce>,
pub latest_commitment_transaction: Option<Transaction>,
pub remote_commitment_points: Vec<(u64, Pubkey)>,
pub remote_channel_public_keys: Option<ChannelBasePublicKeys>,
pub local_shutdown_info: Option<ShutdownInfo>,
pub remote_shutdown_info: Option<ShutdownInfo>,
pub shutdown_transaction_hash: Option<H256>,
pub reestablishing: bool,
pub last_revoke_ack_msg: Option<RevokeAndAck>,
pub created_at: SystemTime,
pub pending_replay_updates: Vec<TlcReplayUpdate>,
pub last_was_revoke: bool,
}Expand description
The core serializable state of a channel actor.
This struct contains all the persistable fields of a channel. Runtime-only fields (like actor references) are managed separately in fiber-lib.
Fields§
§state: ChannelState§public_channel_info: Option<PublicChannelInfo>The data below are only relevant if the channel is public.
local_tlc_info: ChannelTlcInfo§remote_tlc_info: Option<ChannelTlcInfo>§local_pubkey: PubkeyThe local public key used to establish p2p network connection.
remote_pubkey: PubkeyThe remote public key used to establish p2p network connection.
id: Hash256§funding_tx: Option<Transaction>§funding_tx_confirmed_at: Option<(H256, u32, u64)>§funding_udt_type_script: Option<Script>§is_acceptor: boolIs this channel initially inbound? An inbound channel is one where the counterparty is the funder of the channel.
is_one_way: boolIs this channel one-way? Combines with is_acceptor to determine if the channel able to send payment to the counterparty or not.
to_local_amount: u128The amount of CKB/UDT that we own in the channel. This value will only change after we have resolved a tlc.
to_remote_amount: u128The amount of CKB/UDT that the remote owns in the channel. This value will only change after we have resolved a tlc.
local_reserved_ckb_amount: u64These two amounts used to keep the minimal ckb amount for the two parties. TLC operations will not affect these two amounts, only used to keep the commitment transactions to be valid, so that any party can close the channel at any time.
remote_reserved_ckb_amount: u64§commitment_fee_rate: u64The commitment fee rate is used to calculate the fee for the commitment transactions. The side who want to submit the commitment transaction will pay fee.
commitment_delay_epoch: u64The delay time for the commitment transaction, this value is set by the initiator of the channel. It must be a relative EpochNumberWithFraction in u64 format.
funding_fee_rate: u64The fee rate used for funding transaction, the initiator may set it as funding_fee_rate option,
if it’s not set, DEFAULT_FEE_RATE will be used as default value, two sides will use the same fee rate.
signer: InMemorySignerSigner is used to sign the commitment transactions.
local_channel_public_keys: ChannelBasePublicKeysCached channel public keys for easier of access.
commitment_numbers: CommitmentNumbersCommitment numbers that are used to derive keys. This value is guaranteed to be 0 when channel is just created.
local_constraints: ChannelConstraints§remote_constraints: ChannelConstraints§tlc_state: TlcStateAll the TLC related information.
retryable_tlc_operations: VecDeque<RetryableTlcOperation>The retryable tlc operations that are waiting to be processed.
waiting_forward_tlc_tasks: HashMap<TLCId, [u8; 32]>§remote_shutdown_script: Option<Script>The remote lock script for close channel, setup during the channel establishment.
local_shutdown_script: ScriptThe local lock script for close channel.
last_committed_remote_nonce: Option<PubNonce>Basically the latest remote nonce sent by the peer with the CommitmentSigned message, but we will only update this field after we have sent a RevokeAndAck to the peer.
remote_revocation_nonce_for_verify: Option<PubNonce>§remote_revocation_nonce_for_send: Option<PubNonce>§remote_revocation_nonce_for_next: Option<PubNonce>§latest_commitment_transaction: Option<Transaction>The latest commitment transaction we’re holding, it can be broadcasted to blockchain by us to force close the channel.
remote_commitment_points: Vec<(u64, Pubkey)>All the commitment point that are sent from the counterparty. We need to save all these points to derive the keys for the commitment transactions.
remote_channel_public_keys: Option<ChannelBasePublicKeys>§local_shutdown_info: Option<ShutdownInfo>The shutdown info for both local and remote, setup by the shutdown command or message.
remote_shutdown_info: Option<ShutdownInfo>§shutdown_transaction_hash: Option<H256>Transaction hash of the shutdown transaction. The shutdown transaction can be COOPERATIVE or UNCOOPERATIVE.
reestablishing: boolA flag to indicate whether the channel is reestablishing, we won’t process any messages until the channel is reestablished.
last_revoke_ack_msg: Option<RevokeAndAck>§created_at: SystemTime§pending_replay_updates: Vec<TlcReplayUpdate>TLC updates sent to peer since the last local CommitmentSigned. This preserves send order for reestablish replay.
last_was_revoke: boolTracks whether the last outbound sync message was RevokeAndAck.
Trait Implementations§
Source§impl Clone for ChannelActorData
impl Clone for ChannelActorData
Source§fn clone(&self) -> ChannelActorData
fn clone(&self) -> ChannelActorData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more