VAA guardian devnet submission
This commit is contained in:
parent
ed6b8d23de
commit
5a72d9029a
|
@ -48,53 +48,53 @@ func p2p(obsvC chan *gossipv1.LockupObservation, sendC chan []byte) func(ctx con
|
||||||
|
|
||||||
var idht *dht.IpfsDHT
|
var idht *dht.IpfsDHT
|
||||||
|
|
||||||
h, err := libp2p.New(ctx,
|
h, err := libp2p.New(ctx,
|
||||||
// Use the keypair we generated
|
// Use the keypair we generated
|
||||||
libp2p.Identity(priv),
|
libp2p.Identity(priv),
|
||||||
|
|
||||||
// Multiple listen addresses
|
// Multiple listen addresses
|
||||||
libp2p.ListenAddrStrings(
|
libp2p.ListenAddrStrings(
|
||||||
// Listen on QUIC only.
|
// Listen on QUIC only.
|
||||||
// TODO(leo): is this more or less stable than using both TCP and QUIC transports?
|
// TODO(leo): is this more or less stable than using both TCP and QUIC transports?
|
||||||
// https://github.com/libp2p/go-libp2p/issues/688
|
// https://github.com/libp2p/go-libp2p/issues/688
|
||||||
fmt.Sprintf("/ip4/0.0.0.0/udp/%d/quic", *p2pPort),
|
fmt.Sprintf("/ip4/0.0.0.0/udp/%d/quic", *p2pPort),
|
||||||
fmt.Sprintf("/ip6/::/udp/%d/quic", *p2pPort),
|
fmt.Sprintf("/ip6/::/udp/%d/quic", *p2pPort),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Enable TLS security as the only security protocol.
|
// Enable TLS security as the only security protocol.
|
||||||
libp2p.Security(libp2ptls.ID, libp2ptls.New),
|
libp2p.Security(libp2ptls.ID, libp2ptls.New),
|
||||||
|
|
||||||
// Enable QUIC transport as the only transport.
|
// Enable QUIC transport as the only transport.
|
||||||
libp2p.Transport(libp2pquic.NewTransport),
|
libp2p.Transport(libp2pquic.NewTransport),
|
||||||
|
|
||||||
// Let's prevent our peer from having too many
|
// Let's prevent our peer from having too many
|
||||||
// connections by attaching a connection manager.
|
// connections by attaching a connection manager.
|
||||||
libp2p.ConnectionManager(connmgr.NewConnManager(
|
libp2p.ConnectionManager(connmgr.NewConnManager(
|
||||||
100, // Lowwater
|
100, // Lowwater
|
||||||
400, // HighWater,
|
400, // HighWater,
|
||||||
time.Minute, // GracePeriod
|
time.Minute, // GracePeriod
|
||||||
)),
|
)),
|
||||||
|
|
||||||
// Let this host use the DHT to find other hosts
|
// Let this host use the DHT to find other hosts
|
||||||
libp2p.Routing(func(h host.Host) (routing.PeerRouting, error) {
|
libp2p.Routing(func(h host.Host) (routing.PeerRouting, error) {
|
||||||
// TODO(leo): Persistent data store (i.e. address book)
|
// TODO(leo): Persistent data store (i.e. address book)
|
||||||
idht, err = dht.New(ctx, h, dht.Mode(dht.ModeServer),
|
idht, err = dht.New(ctx, h, dht.Mode(dht.ModeServer),
|
||||||
// TODO(leo): This intentionally makes us incompatible with the global IPFS DHT
|
// TODO(leo): This intentionally makes us incompatible with the global IPFS DHT
|
||||||
dht.ProtocolPrefix(protocol.ID("/"+*p2pNetworkID)),
|
dht.ProtocolPrefix(protocol.ID("/"+*p2pNetworkID)),
|
||||||
)
|
|
||||||
return idht, err
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
|
return idht, err
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
// TODO: libp2p cannot be cleanly restarted (https://github.com/libp2p/go-libp2p/issues/992)
|
// TODO: libp2p cannot be cleanly restarted (https://github.com/libp2p/go-libp2p/issues/992)
|
||||||
logger.Error("p2p routine has exited, cancelling root context...", zap.Error(re))
|
logger.Error("p2p routine has exited, cancelling root context...", zap.Error(re))
|
||||||
rootCtxCancel()
|
rootCtxCancel()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
logger.Info("Connecting to bootstrap peers", zap.String("bootstrap_peers", *p2pBootstrap))
|
logger.Info("Connecting to bootstrap peers", zap.String("bootstrap_peers", *p2pBootstrap))
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ func vaaConsensusProcessor(lockC chan *common.ChainLock, setC chan *common.Guard
|
||||||
}
|
}
|
||||||
logger.Info("devnet guardian set change submitted to Ethereum", zap.Any("tx", tx))
|
logger.Info("devnet guardian set change submitted to Ethereum", zap.Any("tx", tx))
|
||||||
|
|
||||||
// TODO: submit to Solana
|
vaaC <- v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ func (e *SolanaBridgeWatcher) Run(ctx context.Context) error {
|
||||||
|
|
||||||
switch event := ev.Event.(type) {
|
switch event := ev.Event.(type) {
|
||||||
case *agentv1.LockupEvent_New:
|
case *agentv1.LockupEvent_New:
|
||||||
logger.Info("received lockup event",
|
logger.Debug("received lockup event",
|
||||||
zap.Any("event", ev)) // TODO: debug level
|
zap.Any("event", ev)) // TODO: debug level
|
||||||
|
|
||||||
lock := &common.ChainLock{
|
lock := &common.ChainLock{
|
||||||
|
|
|
@ -202,7 +202,6 @@ contract Wormhole is ReentrancyGuard {
|
||||||
isWrappedAsset[asset] = true;
|
isWrappedAsset[asset] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(hendrik): nonce
|
|
||||||
function lockAssets(
|
function lockAssets(
|
||||||
address asset,
|
address asset,
|
||||||
uint256 amount,
|
uint256 amount,
|
||||||
|
|
Loading…
Reference in New Issue