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

Make reporting replay system deploys #3397

Merged
merged 24 commits into from Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0507de6
change reporting proto to enable systemDeploy replay
zsluedem May 3, 2021
649194c
rename ReportMemStore.scala to ReportStore.scala and simplified
zsluedem May 3, 2021
9fe895d
fix reportingRspace to generate post checkout
zsluedem May 3, 2021
64440af
create BlockReportAPI.scala and remove blockReport function in BlockA…
zsluedem May 3, 2021
fc62a61
update CasperRhoRuntimeSyntax.scala
zsluedem May 3, 2021
883d925
make ReportingCasper to replay system deploy
zsluedem May 3, 2021
d1b32df
introduce Par(and etc.) circe json encoder
zsluedem May 3, 2021
84996ee
refactor ReportingRoutes.scala
zsluedem May 3, 2021
b8407fb
change how reportingCasper api initialization
zsluedem May 3, 2021
ac56c33
fix test in MultiParentCasperReportingSpec.scala
zsluedem May 3, 2021
2427bca
modify F[EitherT[F, A, B]] to EitherT[F, A, B]
zsluedem May 25, 2021
9094bfd
rename HTTP to Http
zsluedem May 26, 2021
89f68b4
move http reporting api to admin port
zsluedem May 26, 2021
f68b87c
Reporting routes cleanup
tgrospic May 26, 2021
2f75723
Report API remove unused either
tgrospic May 26, 2021
03fb281
runtime set invalid blocks in reporting replay
zsluedem May 28, 2021
fcfc35c
store data in cache after replay
zsluedem Jun 1, 2021
1ce3ef9
make http reporting forceReplay configurable
zsluedem Jun 8, 2021
214386f
Flatten F[EitherT[...]] to EitherT
tgrospic Jun 8, 2021
e248904
Simplify with EitherT.leftT
tgrospic Jun 8, 2021
7e66295
Use Either#fold to escape manual destructure
tgrospic Jun 8, 2021
1b5f4e3
Simplify EitherT[Unit, _] to OptionT
tgrospic Jun 8, 2021
757b768
Remove obsolete type parameter in web api
tgrospic Jun 8, 2021
0609cec
Move reporting HTTP routes to /api/trace, leave legacy /reporting/trace
tgrospic Jun 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
123 changes: 0 additions & 123 deletions casper/src/main/scala/coop/rchain/casper/ReportMemStore.scala

This file was deleted.

32 changes: 32 additions & 0 deletions casper/src/main/scala/coop/rchain/casper/ReportStore.scala
@@ -0,0 +1,32 @@
package coop.rchain.casper

import cats.effect.Sync
import com.google.protobuf.ByteString
import coop.rchain.blockstorage.dag.codecs
import coop.rchain.casper.protocol.BlockEventInfo
import coop.rchain.shared.Compression
import coop.rchain.shared.syntax._
import coop.rchain.store.{KeyValueStoreManager, KeyValueTypedStore}
import net.jpountz.lz4.{LZ4CompressorWithLength, LZ4DecompressorWithLength}
import scodec.SizeBound.unknown
import scodec.{Attempt, Codec, DecodeResult, SizeBound, TransformSyntax}
import scodec.bits.{BitVector, ByteVector}

object ReportStore {

val compressor = new LZ4CompressorWithLength(Compression.factory.fastCompressor())
// val compressor = new LZ4CompressorWithLength(factory.highCompressor(17)) // Max compression
val decompressor = new LZ4DecompressorWithLength(Compression.factory.fastDecompressor())

def compressBytes(bytes: Array[Byte]): Array[Byte] = compressor.compress(bytes)

type ReportStore[F[_]] = KeyValueTypedStore[F, ByteString, BlockEventInfo]

val blockEventInfoCodecCompressed =
scodec.codecs.bytes.xmap[BlockEventInfo](
bv => BlockEventInfo.parseFrom(decompressor.decompress(bv.toArray)),
bei => ByteVector(compressor.compress(bei.toByteArray))
)
def store[F[_]: Sync](kvm: KeyValueStoreManager[F]): F[ReportStore[F]] =
kvm.database("reporting-cache", codecs.codecByteString, blockEventInfoCodecCompressed)
}