-
Notifications
You must be signed in to change notification settings - Fork 861
Added GigaRouter stub (CON-157) #2775
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2775 +/- ##
==========================================
+ Coverage 47.09% 56.64% +9.54%
==========================================
Files 1939 2015 +76
Lines 159354 165305 +5951
==========================================
+ Hits 75053 93633 +18580
+ Misses 77801 63468 -14333
- Partials 6500 8204 +1704
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| for _, ch := range q.channels { | ||
| // Exponential decay of stats. | ||
| // TODO(gprusak): This is not atomic at all. | ||
| ch.recentlySent.Store(uint64(float64(ch.recentlySent.Load()) * 0.8)) | ||
| } |
Check warning
Code scanning / CodeQL
Iteration over map Warning
| for { | ||
| if q.ping { | ||
| q.ping = false | ||
| q.setFlush(time.Now()) |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| } | ||
| if q.pong { | ||
| q.pong = false | ||
| q.setFlush(time.Now()) |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| for _, channel := range q.channels { | ||
| if channel.queue.Len() == 0 { | ||
| continue | ||
| } | ||
| if ratio := channel.ratio(); ratio < leastRatio { | ||
| leastRatio = ratio | ||
| leastChannel = channel | ||
| } | ||
| } |
Check warning
Code scanning / CodeQL
Iteration over map Warning
| } | ||
| } | ||
| if leastChannel != nil { | ||
| q.setFlush(time.Now().Add(c.config.FlushThrottle)) |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| _ "github.com/tendermint/tendermint/internal/hashable/pb" | ||
| protoreflect "google.golang.org/protobuf/reflect/protoreflect" | ||
| protoimpl "google.golang.org/protobuf/runtime/protoimpl" | ||
| reflect "reflect" |
Check notice
Code scanning / CodeQL
Sensitive package import Note
| protoimpl "google.golang.org/protobuf/runtime/protoimpl" | ||
| reflect "reflect" | ||
| sync "sync" | ||
| unsafe "unsafe" |
Check notice
Code scanning / CodeQL
Sensitive package import Note
| for _, ch := range q.channels { | ||
| // Exponential decay of stats. | ||
| // TODO(gprusak): This is not atomic at all. | ||
| ch.recentlySent.Store(uint64(float64(ch.recentlySent.Load()) * 0.8)) |
Check notice
Code scanning / CodeQL
Floating point arithmetic Note
| } | ||
|
|
||
| func (ch *sendChannel) ratio() float32 { | ||
| return float32(ch.recentlySent.Load()) / float32(ch.desc.Priority) |
Check notice
Code scanning / CodeQL
Floating point arithmetic Note
| "github.com/tendermint/tendermint/libs/utils" | ||
| "github.com/tendermint/tendermint/libs/utils/scope" | ||
| "golang.org/x/time/rate" | ||
| "reflect" |
Check notice
Code scanning / CodeQL
Sensitive package import Note
GigaRouter is a router which will handle seigiga p2p connections. GigaRouter shares the tcp port with SeiV2 Router - I've added a bool flag to the handshake message to distinguish one from another (for backward compatibility both peers need to set it for the connection to be considered Giga). It can be enabled by setting Giga config in the RouterOptions. Currently it is hardcoded to None (i.e. disabled). It is a stub in a sense that all the autobahn RPCs are already defined, but there is no logic handling those. The next PR will be porting the autobahn core logic to sei-chain. Additionally: