-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NODE-2337: Ethereum transaction support (#3519)
- Loading branch information
Sergey Nazarov
authored
Oct 19, 2021
1 parent
a0e4f7d
commit e6e3c03
Showing
408 changed files
with
7,628 additions
and
3,787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
*.sh text eol=lf | ||
*.scala text eol=lf | ||
* text=auto | ||
node/src/main/resources/swagger-ui/* linguist-vendored |
38 changes: 38 additions & 0 deletions
38
benchmark/src/test/scala/com/wavesplatform/lang/v1/AddressFromPublicKeyBenchmark.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.wavesplatform.lang.v1 | ||
import java.util.concurrent.TimeUnit | ||
|
||
import com.wavesplatform.common.state.ByteStr | ||
import com.wavesplatform.lang.directives.DirectiveSet | ||
import com.wavesplatform.lang.directives.values.{Account, Expression, V6} | ||
import com.wavesplatform.lang.utils.lazyContexts | ||
import com.wavesplatform.lang.v1.EnvironmentFunctionsBenchmark.curve25519 | ||
import com.wavesplatform.lang.v1.compiler.Terms.EXPR | ||
import com.wavesplatform.lang.v1.compiler.TestCompiler | ||
import com.wavesplatform.lang.v1.evaluator.EvaluatorV2 | ||
import com.wavesplatform.utils.EthHelpers | ||
import org.openjdk.jmh.annotations._ | ||
import org.openjdk.jmh.infra.Blackhole | ||
|
||
@OutputTimeUnit(TimeUnit.MICROSECONDS) | ||
@BenchmarkMode(Array(Mode.AverageTime)) | ||
@Threads(1) | ||
@Fork(1) | ||
@Warmup(iterations = 10, time = 1) | ||
@Measurement(iterations = 10, time = 1) | ||
class AddressFromPublicKeyBenchmark { | ||
@Benchmark | ||
def addressFromPublicKeyWaves(s: PkSt, bh: Blackhole): Unit = bh.consume(EvaluatorV2.applyCompleted(s.ctx, s.exprWaves, V6)) | ||
|
||
@Benchmark | ||
def addressFromPublicKeyEth(s: PkSt, bh: Blackhole): Unit = bh.consume(EvaluatorV2.applyCompleted(s.ctx, s.exprEth, V6)) | ||
} | ||
|
||
@State(Scope.Benchmark) | ||
class PkSt extends EthHelpers { | ||
val ds = DirectiveSet(V6, Account, Expression).fold(null, identity) | ||
val ctx = lazyContexts(ds).value().evaluationContext(EnvironmentFunctionsBenchmark.environment) | ||
|
||
val wavesPk = ByteStr(curve25519.generateKeypair._2) | ||
val exprWaves = TestCompiler(V6).compileExpression(s"addressFromPublicKey(base58'$wavesPk')").expr.asInstanceOf[EXPR] | ||
val exprEth = TestCompiler(V6).compileExpression(s"addressFromPublicKey(base58'$TestEthPublicKey')").expr.asInstanceOf[EXPR] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.