-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta: add a way to self generate types
This is a change for the gossip map that use a compiler that generate the messages that are used inside the gossip map. Signed-off-by: Vincenzo Palazzo <[email protected]>
- Loading branch information
1 parent
3ee46cb
commit a549b69
Showing
11 changed files
with
523 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
msgtype,announcement_signatures,259 | ||
msgdata,announcement_signatures,channel_id,channel_id, | ||
msgdata,announcement_signatures,short_channel_id,short_channel_id, | ||
msgdata,announcement_signatures,node_signature,signature, | ||
msgdata,announcement_signatures,bitcoin_signature,signature, | ||
msgtype,channel_announcement,256 | ||
msgdata,channel_announcement,node_signature_1,signature, | ||
msgdata,channel_announcement,node_signature_2,signature, | ||
msgdata,channel_announcement,bitcoin_signature_1,signature, | ||
msgdata,channel_announcement,bitcoin_signature_2,signature, | ||
msgdata,channel_announcement,len,u16, | ||
msgdata,channel_announcement,features,byte,len | ||
msgdata,channel_announcement,chain_hash,chain_hash, | ||
msgdata,channel_announcement,short_channel_id,short_channel_id, | ||
msgdata,channel_announcement,node_id_1,point, | ||
msgdata,channel_announcement,node_id_2,point, | ||
msgdata,channel_announcement,bitcoin_key_1,point, | ||
msgdata,channel_announcement,bitcoin_key_2,point, | ||
msgtype,node_announcement,257 | ||
msgdata,node_announcement,signature,signature, | ||
msgdata,node_announcement,flen,u16, | ||
msgdata,node_announcement,features,byte,flen | ||
msgdata,node_announcement,timestamp,u32, | ||
msgdata,node_announcement,node_id,point, | ||
msgdata,node_announcement,rgb_color,byte,3 | ||
msgdata,node_announcement,alias,byte,32 | ||
msgdata,node_announcement,addrlen,u16, | ||
msgdata,node_announcement,addresses,byte,addrlen | ||
msgtype,channel_update,258 | ||
msgdata,channel_update,signature,signature, | ||
msgdata,channel_update,chain_hash,chain_hash, | ||
msgdata,channel_update,short_channel_id,short_channel_id, | ||
msgdata,channel_update,timestamp,u32, | ||
msgdata,channel_update,message_flags,byte, | ||
msgdata,channel_update,channel_flags,byte, | ||
msgdata,channel_update,cltv_expiry_delta,u16, | ||
msgdata,channel_update,htlc_minimum_msat,u64, | ||
msgdata,channel_update,fee_base_msat,u32, | ||
msgdata,channel_update,fee_proportional_millionths,u32, | ||
msgdata,channel_update,htlc_maximum_msat,u64, | ||
msgtype,query_short_channel_ids,261 | ||
msgdata,query_short_channel_ids,chain_hash,chain_hash, | ||
msgdata,query_short_channel_ids,len,u16, | ||
msgdata,query_short_channel_ids,encoded_short_ids,byte,len | ||
msgdata,query_short_channel_ids,tlvs,query_short_channel_ids_tlvs, | ||
tlvtype,query_short_channel_ids_tlvs,query_flags,1 | ||
tlvdata,query_short_channel_ids_tlvs,query_flags,encoding_type,byte, | ||
tlvdata,query_short_channel_ids_tlvs,query_flags,encoded_query_flags,byte,... | ||
msgtype,reply_short_channel_ids_end,262 | ||
msgdata,reply_short_channel_ids_end,chain_hash,chain_hash, | ||
msgdata,reply_short_channel_ids_end,full_information,byte, | ||
msgtype,query_channel_range,263 | ||
msgdata,query_channel_range,chain_hash,chain_hash, | ||
msgdata,query_channel_range,first_blocknum,u32, | ||
msgdata,query_channel_range,number_of_blocks,u32, | ||
msgdata,query_channel_range,tlvs,query_channel_range_tlvs, | ||
tlvtype,query_channel_range_tlvs,query_option,1 | ||
tlvdata,query_channel_range_tlvs,query_option,query_option_flags,bigsize, | ||
msgtype,reply_channel_range,264 | ||
msgdata,reply_channel_range,chain_hash,chain_hash, | ||
msgdata,reply_channel_range,first_blocknum,u32, | ||
msgdata,reply_channel_range,number_of_blocks,u32, | ||
msgdata,reply_channel_range,sync_complete,byte, | ||
msgdata,reply_channel_range,len,u16, | ||
msgdata,reply_channel_range,encoded_short_ids,byte,len | ||
msgdata,reply_channel_range,tlvs,reply_channel_range_tlvs, | ||
tlvtype,reply_channel_range_tlvs,timestamps_tlv,1 | ||
tlvdata,reply_channel_range_tlvs,timestamps_tlv,encoding_type,byte, | ||
tlvdata,reply_channel_range_tlvs,timestamps_tlv,encoded_timestamps,byte,... | ||
tlvtype,reply_channel_range_tlvs,checksums_tlv,3 | ||
tlvdata,reply_channel_range_tlvs,checksums_tlv,checksums,channel_update_checksums,... | ||
subtype,channel_update_timestamps | ||
subtypedata,channel_update_timestamps,timestamp_node_id_1,u32, | ||
subtypedata,channel_update_timestamps,timestamp_node_id_2,u32, | ||
subtype,channel_update_checksums | ||
subtypedata,channel_update_checksums,checksum_node_id_1,u32, | ||
subtypedata,channel_update_checksums,checksum_node_id_2,u32, | ||
msgtype,gossip_timestamp_filter,265 | ||
msgdata,gossip_timestamp_filter,chain_hash,chain_hash, | ||
msgdata,gossip_timestamp_filter,first_timestamp,u32, | ||
msgdata,gossip_timestamp_filter,timestamp_range,u32, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# gossip_store messages: messages persisted in the gossip_store | ||
# We store raw messages here, so these numbers must not overlap with | ||
# 256/257/258. | ||
#include <common/amount.h> | ||
#include <common/node_id.h> | ||
|
||
# This always follows the channel_announce / private_announce | ||
msgtype,gossip_store_channel_amount,4101 | ||
msgdata,gossip_store_channel_amount,satoshis,amount_sat, | ||
|
||
# Mimics a channel_announce, except signatures are all-zero | ||
msgtype,gossip_store_private_channel_obs,4104 | ||
msgdata,gossip_store_private_channel_obs,satoshis,amount_sat, | ||
msgdata,gossip_store_private_channel_obs,len,u16, | ||
msgdata,gossip_store_private_channel_obs,announcement,u8,len | ||
|
||
msgtype,gossip_store_private_update_obs,4102 | ||
msgdata,gossip_store_private_update_obs,len,u16, | ||
msgdata,gossip_store_private_update_obs,update,u8,len | ||
|
||
msgtype,gossip_store_delete_chan,4103 | ||
msgdata,gossip_store_delete_chan,scid,short_channel_id, | ||
|
||
msgtype,gossip_store_ended,4105 | ||
msgdata,gossip_store_ended,equivalent_offset,u64, | ||
|
||
msgtype,gossip_store_chan_dying,4106 | ||
msgdata,gossip_store_chan_dying,scid,short_channel_id, | ||
msgdata,gossip_store_chan_dying,blockheight,u32, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
// code generated with the lngen, please not edit this file. | ||
use std::io::{Read, Write}; | ||
|
||
use fundamentals_derive::{DecodeWire, EncodeWire}; | ||
|
||
use crate::core::{FromWire, ToWire}; | ||
use crate::prelude::*; | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct AnnouncementSignatures { | ||
#[msg_type = 259] | ||
pub ty: u16, | ||
pub channel_id: ChannelId, | ||
pub short_channel_id: ShortChannelId, | ||
pub node_signature: Signature, | ||
pub bitcoin_signature: Signature, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct ChannelAnnouncement { | ||
#[msg_type = 256] | ||
pub ty: u16, | ||
pub node_signature_1: Signature, | ||
pub node_signature_2: Signature, | ||
pub bitcoin_signature_1: Signature, | ||
pub bitcoin_signature_2: Signature, | ||
pub features: BitFlag, | ||
pub chain_hash: ChainHash, | ||
pub short_channel_id: ShortChannelId, | ||
pub node_id_1: Point, | ||
pub node_id_2: Point, | ||
pub bitcoin_key_1: Point, | ||
pub bitcoin_key_2: Point, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct ChannelUpdate { | ||
#[msg_type = 258] | ||
pub ty: u16, | ||
pub signature: Signature, | ||
pub chain_hash: ChainHash, | ||
pub short_channel_id: ShortChannelId, | ||
pub timestamp: u32, | ||
pub message_flags: BitFlag, | ||
pub channel_flags: BitFlag, | ||
pub cltv_expiry_delta: u16, | ||
pub htlc_minimum_msat: u64, | ||
pub fee_base_msat: u32, | ||
pub fee_proportional_millionths: u32, | ||
pub htlc_maximum_msat: u64, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct GossipTimestampFilter { | ||
#[msg_type = 265] | ||
pub ty: u16, | ||
pub chain_hash: ChainHash, | ||
pub first_timestamp: u32, | ||
pub timestamp_range: u32, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct NodeAnnouncement { | ||
#[msg_type = 257] | ||
pub ty: u16, | ||
pub signature: Signature, | ||
pub features: BitFlag, | ||
pub timestamp: u32, | ||
pub node_id: Point, | ||
pub rgb_color: BitFlag, | ||
pub alias: BitFlag, | ||
pub addresses: BitFlag, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct QueryChannelRange { | ||
#[msg_type = 263] | ||
pub ty: u16, | ||
pub chain_hash: ChainHash, | ||
pub first_blocknum: u32, | ||
pub number_of_blocks: u32, | ||
pub query_channel_range_tlvs: Stream, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct QueryShortChannelIds { | ||
#[msg_type = 261] | ||
pub ty: u16, | ||
pub chain_hash: ChainHash, | ||
pub encoded_short_ids: BitFlag, | ||
pub query_short_channel_ids_tlvs: Stream, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct ReplyChannelRange { | ||
#[msg_type = 264] | ||
pub ty: u16, | ||
pub chain_hash: ChainHash, | ||
pub first_blocknum: u32, | ||
pub number_of_blocks: u32, | ||
pub sync_complete: BitFlag, | ||
pub encoded_short_ids: BitFlag, | ||
pub reply_channel_range_tlvs: Stream, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct ReplyShortChannelIdsEnd { | ||
#[msg_type = 262] | ||
pub ty: u16, | ||
pub chain_hash: ChainHash, | ||
pub full_information: BitFlag, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// code generated with the lngen, please not edit this file. | ||
use std::io::{Read, Write}; | ||
|
||
use fundamentals_derive::{DecodeWire, EncodeWire}; | ||
|
||
use crate::core::{FromWire, ToWire}; | ||
use crate::prelude::*; | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct GossipStoreChanDying { | ||
#[msg_type = 4106] | ||
pub ty: u16, | ||
pub scid: ShortChannelId, | ||
pub blockheight: u32, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct GossipStoreChannelAmount { | ||
#[msg_type = 4101] | ||
pub ty: u16, | ||
pub satoshis: u64, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct GossipStoreDeleteChan { | ||
#[msg_type = 4103] | ||
pub ty: u16, | ||
pub scid: ShortChannelId, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct GossipStoreEnded { | ||
#[msg_type = 4105] | ||
pub ty: u16, | ||
pub equivalent_offset: u64, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct GossipStorePrivateChannelObs { | ||
#[msg_type = 4104] | ||
pub ty: u16, | ||
pub satoshis: u64, | ||
pub announcement: BitFlag, | ||
} | ||
|
||
#[derive(DecodeWire, EncodeWire, Debug, Clone)] | ||
pub struct GossipStorePrivateUpdateObs { | ||
#[msg_type = 4102] | ||
pub ty: u16, | ||
pub update: BitFlag, | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.