Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(taiko-client): p2p network for soft block sharing #18528

Open
wants to merge 9 commits into
base: preconf-driver-apis
Choose a base branch
from

Conversation

cyberhorsey
Copy link
Contributor

No description provided.

@@ -90,13 +108,19 @@ func (d *Driver) InitFromConfig(ctx context.Context, cfg *Config) (err error) {

d.l1HeadSub = d.state.SubL1HeadsFeed(d.l1HeadCh)

d.p2pnetwork, err = p2p.NewNetwork(d.ctx, d.Config.P2PNetworkBootstrapNodeURL, d.Config.P2PNetworkPort)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need another flag to open or close p2pnetwork.

@mask-pp
Copy link
Contributor

mask-pp commented Dec 11, 2024

If some peers offlined how can we know or do we need to manage it?

})
}

func (n *Network) Close() error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call this function in driver.Close().

}

func JoinTopic[T any](_ context.Context, n *Network, topicName string, topicHandler topicHandlerFunc[T]) error {
topic, err := n.ps.Join(topicName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repeated calls will report error

@@ -185,6 +131,16 @@ func (s *SoftBlockAPIServer) BuildSoftBlock(c echo.Context) error {
}
}

// publish to network
if err := p2p.Publish[softblocks.TransactionBatch](
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check s.p2pNetwork != nil at first.

@mask-pp
Copy link
Contributor

mask-pp commented Dec 12, 2024

When starting a boot node peer, it is recommended to support a private key for a fixed Peer ID.

@cyberhorsey
Copy link
Contributor Author

When starting a boot node peer, it is recommended to support a private key for a fixed Peer ID.

the actual p2p will be in a sidecar not directly in client most likely, this is just a basic POC.

@mask-pp
Copy link
Contributor

mask-pp commented Dec 15, 2024

When starting a boot node peer, it is recommended to support a private key for a fixed Peer ID.

the actual p2p will be in a sidecar not directly in client most likely, this is just a basic POC.

Ok, from a proof-of-concept perspective, it's enough.

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

Successfully merging this pull request may close these issues.

3 participants