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
ec-555 #294
ec-555 #294
Conversation
syntax = "proto3"; | ||
import "scalapb/scalapb.proto"; | ||
|
||
option optimize_for = SPEED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary to set optimize_for to speed
case Payload.`modifierTypeId` => PayloadSerializer.parseBytes(bytes.tail) | ||
case m => Failure(new Exception(s"Deserialization for unknown type byte: $m")) | ||
} | ||
def fromProto(bytes: Array[Byte]): Try[EncryPersistentModifier] = Try(bytes.head).flatMap { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can match bytes head directly
case MessageFromNetwork(message, Some(remote)) => | ||
message match { | ||
case message@SyncInfoNetworkMessage(_) => | ||
findHandler(message, NetworkMessagesIds.SyncInfo, remote, messagesHandlers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add check for data size (objects qty)
src/main/resources/application.conf
Outdated
logger-startup-timeout = 60s | ||
loggers = ["akka.event.slf4j.Slf4jLogger"] | ||
actor.warn-about-java-serializer-usage = false | ||
persistence { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove persistence settings
transferDirectiveWithoutTokenIdFromProto.get.tokenIdOpt shouldBe None | ||
} | ||
|
||
property("Transaction should be serialized correctly") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add test for signature compr
@@ -103,37 +102,41 @@ class PeerConnectionHandler(messagesHandler: MessageHandler, | |||
peerManager ! Handshaked(peer) | |||
handshakeTimeoutCancellableOpt.map(_.cancel()) | |||
connection ! ResumeReading | |||
logger.info(s"Context become workingCycle on peerHandler") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to debug
mH.find(_._1.contains(messageId)).map(_._2) match { | ||
case Some(handler) => | ||
handler ! DataFromPeer(message, remote) | ||
logger.info(s"Send message DataFromPeer with ${message.messageName} to $handler.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to debug
@@ -26,6 +28,8 @@ class MinerWalletBalanceTest extends AsyncFunSuite with Matchers with NodesFromD | |||
|
|||
val height = dockerNodes().head.waitForHeadersHeight(heightToCheck) | |||
Await.result(height, 30.minutes) | |||
val boxes: Seq[EncryBaseBox] = Await.result(dockerNodes().head.outputs, 30.minutes) | |||
val oneBox: AssetBox = boxes.collect { case ab: AssetBox => ab }.head |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This val is not used anywhere (same as one above)
val syncInfoToProto: GeneralizedNetworkProtoMessage.InnerMessage = syncInfoBeforeProto.toInnerMessage | ||
val syncInfoFromProto: Option[SyncInfoNetworkMessage] = SyncInfoNetworkMessageSerializer.fromProto(syncInfoToProto) | ||
|
||
val comparison: Set[Boolean] = syncInfoFromProto.get.esi.lastHeaderIds.map(id => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use forall instead of map
case Failure(e) => logger.error(s"Failed to deserialize data: $e") | ||
} | ||
case MessageFromNetwork(message, Some(remote)) if message.isValid(settings) => | ||
logger.info(s"Got ${message.messageName} on the NetworkController.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to debug
No description provided.