Skip to content

Commit 56f159d

Browse files
committed
Use libevm instead of coreth (#3918)
Co-authored-by: Stephen Buttolph <[email protected]> ## Why this should be merged ## How this works ## How this was tested ## Need to be documented in RELEASES.md?
1 parent 883cebf commit 56f159d

File tree

6 files changed

+1262
-26
lines changed

6 files changed

+1262
-26
lines changed

message/fields.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ var (
6262
_ deadlineGetter = (*p2p.PushQuery)(nil)
6363
_ deadlineGetter = (*p2p.PullQuery)(nil)
6464
_ deadlineGetter = (*p2p.AppRequest)(nil)
65+
66+
_ chainIDGetter = (*p2p.SimplexMessage)(nil)
6567
)
6668

6769
type chainIDGetter interface {

proto/p2p/p2p.proto

Lines changed: 98 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ option go_package = "github.com/ava-labs/avalanchego/proto/pb/p2p";
99
// Only one type can be non-null.
1010
message Message {
1111
reserved 1; // Until E upgrade is activated.
12-
reserved 36; // Next unused field number.
12+
reserved 37; // Next unused field number.
1313
// NOTES
1414
// Use "oneof" for each message type and set rest to null if not used.
1515
// That is because when the compression is enabled, we don't want to include uncompressed fields.
@@ -55,6 +55,9 @@ message Message {
5555
AppResponse app_response = 31;
5656
AppGossip app_gossip = 32;
5757
AppError app_error = 34;
58+
59+
// Simplex messages:
60+
SimplexMessage simplex_message = 36;
5861
}
5962
}
6063

@@ -419,3 +422,97 @@ message AppGossip {
419422
// Message body
420423
bytes app_bytes = 2;
421424
}
425+
426+
message SimplexMessage {
427+
// Chain being responded from
428+
bytes chain_id = 1;
429+
430+
oneof message {
431+
Block block = 2;
432+
Vote vote = 3;
433+
EmptyVote empty_vote = 4;
434+
Finalization finalization = 5;
435+
Notarization notarization = 6;
436+
EmptyNotarization empty_notarization = 7;
437+
FinalizationCertificate finalization_certificate = 8;
438+
ReplicationResponse replication_response = 9;
439+
ReplicationRequest replication_request = 10;
440+
}
441+
}
442+
443+
message Block {
444+
bytes block = 1;
445+
Vote vote = 2;
446+
}
447+
448+
message ProtocolMetadata {
449+
// Version defines the version of the protocol this block was created with.
450+
uint32 version = 1;
451+
// Epoch returns the epoch in which the block was proposed
452+
uint64 epoch = 2;
453+
// Round returns the round number in which the block was proposed.
454+
// Can also be an empty block.
455+
uint64 round = 3;
456+
// Seq is the order of the block among all blocks in the blockchain.
457+
// Cannot correspond to an empty block.
458+
uint64 seq = 4;
459+
// Prev returns the digest of the previous data block
460+
bytes prev = 5;
461+
}
462+
463+
message BlockHeader {
464+
ProtocolMetadata metadata = 1;
465+
bytes digest = 2;
466+
}
467+
468+
message Signature {
469+
bytes signer = 1;
470+
bytes value = 2;
471+
}
472+
473+
message Vote {
474+
BlockHeader vote = 1;
475+
Signature signature = 2;
476+
}
477+
478+
message EmptyVote {
479+
ProtocolMetadata vote = 1;
480+
Signature signature = 2;
481+
}
482+
483+
message Finalization {
484+
BlockHeader vote = 1;
485+
Signature signature = 2;
486+
}
487+
488+
message FinalizationCertificate {
489+
Finalization finalization = 1;
490+
bytes quorum_certificate = 2;
491+
}
492+
493+
message Notarization {
494+
BlockHeader vote = 1;
495+
bytes quorum_certificate = 2;
496+
}
497+
498+
message EmptyNotarization {
499+
BlockHeader empty_vote = 1;
500+
bytes quorum_certificate = 2;
501+
}
502+
503+
message ReplicationRequest {
504+
repeated uint64 seqs = 1; // array of seqs being requested
505+
uint64 latest_round = 2; // latest round, our node has
506+
}
507+
508+
message ReplicationResponse {
509+
repeated QuorumRound data = 1;
510+
QuorumRound latest_round = 2;
511+
}
512+
513+
message QuorumRound {
514+
Block block = 1;
515+
Notarization notarization = 2;
516+
EmptyNotarization empty_notarization = 3;
517+
FinalizationCertificate finalization = 4;
518+
}

0 commit comments

Comments
 (0)