Skip to content

Commit 3f9f261

Browse files
committed
Merge remote-tracking branch 'origin/develop' into etcm-103/restartable-state-sync
2 parents 6234ff2 + a66c59f commit 3f9f261

File tree

69 files changed

+1918
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1918
-705
lines changed

.jvmopts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-Xms1g
2+
-Xmx4g
3+
-XX:ReservedCodeCacheSize=128m
4+
-XX:MaxMetaspaceSize=1g

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ scalacOptions := Seq(
8585
"-Xlint:unsound-match",
8686
"-Ywarn-inaccessible",
8787
"-Ywarn-unused-import",
88+
"-Ypartial-unification",
8889
"-encoding",
8990
"utf-8"
9091
)

insomnia_workspace.json

Lines changed: 207 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,95 @@
11
{
22
"_type": "export",
33
"__export_format": 4,
4-
"__export_date": "2020-09-30T20:01:40.792Z",
4+
"__export_date": "2020-10-02T11:18:34.806Z",
55
"__export_source": "insomnia.desktop.app:v2020.4.1",
66
"resources": [
7+
{
8+
"_id": "req_4222a4d54ba24fa7813429bdcdb732df",
9+
"parentId": "fld_a7212a5b96194230a7e0abc76ee2bf26",
10+
"modified": 1601637263922,
11+
"created": 1601637164399,
12+
"url": "{{ node_url }}",
13+
"name": "checkpointing_getLatestBlock",
14+
"description": "",
15+
"method": "POST",
16+
"body": {
17+
"mimeType": "application/json",
18+
"text": "{\n\t\"jsonrpc\": \"2.0\",\n\t\"id\": 1,\n\t\"method\": \"checkpointing_getLatestBlock\",\n\t\"params\": [5]\n}"
19+
},
20+
"parameters": [],
21+
"headers": [
22+
{
23+
"name": "Content-Type",
24+
"value": "application/json",
25+
"id": "pair_a28efff3b44442d99b7f3fbc54d8c9b6"
26+
}
27+
],
28+
"authentication": {},
29+
"metaSortKey": -1601637164399,
30+
"isPrivate": false,
31+
"settingStoreCookies": true,
32+
"settingSendCookies": true,
33+
"settingDisableRenderRequestBody": false,
34+
"settingEncodeUrl": true,
35+
"settingRebuildPath": true,
36+
"settingFollowRedirects": "global",
37+
"_type": "request"
38+
},
39+
{
40+
"_id": "fld_a7212a5b96194230a7e0abc76ee2bf26",
41+
"parentId": "wrk_097d43914a4d4aea8b6f73f647921182",
42+
"modified": 1601637156313,
43+
"created": 1601637156313,
44+
"name": "Checkpointing",
45+
"description": "",
46+
"environment": {},
47+
"environmentPropertyOrder": null,
48+
"metaSortKey": -1601637156313,
49+
"_type": "request_group"
50+
},
51+
{
52+
"_id": "wrk_097d43914a4d4aea8b6f73f647921182",
53+
"parentId": null,
54+
"modified": 1599825617921,
55+
"created": 1552662762769,
56+
"name": "Mantis",
57+
"description": "",
58+
"scope": null,
59+
"_type": "workspace"
60+
},
61+
{
62+
"_id": "req_da1e409360394849b673ec4e27f542b6",
63+
"parentId": "fld_a7212a5b96194230a7e0abc76ee2bf26",
64+
"modified": 1601637193229,
65+
"created": 1601637186866,
66+
"url": "{{ node_url }}",
67+
"name": "checkpointing_pushCheckpoint",
68+
"description": "",
69+
"method": "POST",
70+
"body": {
71+
"mimeType": "application/json",
72+
"text": "{\n\t\"jsonrpc\": \"2.0\",\n\t\"id\": 1,\n\t\"method\": \"checkpointing_pushCheckpoint\",\n\t\"params\": [\n\t\t\"127d6fde40d20208641c057a1ad4d12d44433881a660b15ac99f04f25762fb9b\",\n\t\t[\n\t\"2194b40851c648e7570e75ea2c507887d11c2270f7523469953fc5c3d5e0f50f48d73ea0b827eb81bb2fc0511f09d10b8f1d3f88e251ed231bb0f5cd03826d281b\",\n\t\t\t\"bbd4ae567202a6e7f40826c964a918760253596bb92052ea7ef4b30338b19fc12d56d497c88f0f13eff0ad542a8a4c1069559cb43e9741b849bf6577287450e31b\"\n\t\t]\n\t]\n}"
73+
},
74+
"parameters": [],
75+
"headers": [
76+
{
77+
"name": "Content-Type",
78+
"value": "application/json",
79+
"id": "pair_a28efff3b44442d99b7f3fbc54d8c9b6"
80+
}
81+
],
82+
"authentication": {},
83+
"metaSortKey": -1583661254601.5,
84+
"isPrivate": false,
85+
"settingStoreCookies": true,
86+
"settingSendCookies": true,
87+
"settingDisableRenderRequestBody": false,
88+
"settingEncodeUrl": true,
89+
"settingRebuildPath": true,
90+
"settingFollowRedirects": "global",
91+
"_type": "request"
92+
},
793
{
894
"_id": "req_cd0078ce4a034ebdbdf7dc9e20e78a29",
995
"parentId": "fld_2b54cbb84e244284b3ef752c5f805376",
@@ -53,16 +139,6 @@
53139
"metaSortKey": -1600249374160,
54140
"_type": "request_group"
55141
},
56-
{
57-
"_id": "wrk_097d43914a4d4aea8b6f73f647921182",
58-
"parentId": null,
59-
"modified": 1599825617921,
60-
"created": 1552662762769,
61-
"name": "Mantis",
62-
"description": "",
63-
"scope": null,
64-
"_type": "workspace"
65-
},
66142
{
67143
"_id": "req_6197fefa1e1448a89f30712ec12295f8",
68144
"parentId": "fld_2b54cbb84e244284b3ef752c5f805376",
@@ -737,6 +813,117 @@
737813
"settingFollowRedirects": "global",
738814
"_type": "request"
739815
},
816+
{
817+
"_id": "req_056848524b07432f9f0167540b54903b",
818+
"parentId": "fld_a06eb77e183c4727800eb7dc43ceabe1",
819+
"modified": 1602080919748,
820+
"created": 1602080239083,
821+
"url": "{{ node_url }}",
822+
"name": "eth_getRawTransactionByHash",
823+
"description": "Returns raw transaction data of a transaction with the given hash",
824+
"method": "POST",
825+
"body": {
826+
"mimeType": "application/json",
827+
"text": "{\n\t\"jsonrpc\": \"2.0\",\n \"method\": \"eth_getRawTransactionByHash\", \n\t\"params\": [\"0x926db397ed35bedee660fe5bf6879679fa71f1fe8c27823f7f6a1e5d96a49b94\"],\n \"id\": 1\n}"
828+
},
829+
"parameters": [],
830+
"headers": [
831+
{
832+
"id": "pair_9f4d6a9dde554cd384487e04fa3b21aa",
833+
"name": "Content-Type",
834+
"value": "application/json"
835+
},
836+
{
837+
"id": "pair_088edc31f5e04f20a16b465a673871bb",
838+
"name": "Cache-Control",
839+
"value": "no-cache"
840+
}
841+
],
842+
"authentication": {},
843+
"metaSortKey": -1552732410741.25,
844+
"isPrivate": false,
845+
"settingStoreCookies": true,
846+
"settingSendCookies": true,
847+
"settingDisableRenderRequestBody": false,
848+
"settingEncodeUrl": true,
849+
"settingRebuildPath": true,
850+
"settingFollowRedirects": "global",
851+
"_type": "request"
852+
},
853+
{
854+
"_id": "req_e9008e2f2aa14acca2f3e6eca0c30677",
855+
"parentId": "fld_a06eb77e183c4727800eb7dc43ceabe1",
856+
"modified": 1602080922028,
857+
"created": 1602080826211,
858+
"url": "{{ node_url }}",
859+
"name": "eth_getRawTransactionByBlockHashAndIndex",
860+
"description": "Returns raw transaction data of a transaction with the block hash and index of which it was mined",
861+
"method": "POST",
862+
"body": {
863+
"mimeType": "application/json",
864+
"text": "{\n\t\"jsonrpc\": \"2.0\",\n \"method\": \"eth_getRawTransactionByBlockHashAndIndex\", \n\t\"params\": [\"0x926db397ed35bedee660fe5bf6879679fa71f1fe8c27823f7f6a1e5d96a49b94\"],\n \"id\": 1\n}"
865+
},
866+
"parameters": [],
867+
"headers": [
868+
{
869+
"id": "pair_9f4d6a9dde554cd384487e04fa3b21aa",
870+
"name": "Content-Type",
871+
"value": "application/json"
872+
},
873+
{
874+
"id": "pair_088edc31f5e04f20a16b465a673871bb",
875+
"name": "Cache-Control",
876+
"value": "no-cache"
877+
}
878+
],
879+
"authentication": {},
880+
"metaSortKey": -1552732410728.75,
881+
"isPrivate": false,
882+
"settingStoreCookies": true,
883+
"settingSendCookies": true,
884+
"settingDisableRenderRequestBody": false,
885+
"settingEncodeUrl": true,
886+
"settingRebuildPath": true,
887+
"settingFollowRedirects": "global",
888+
"_type": "request"
889+
},
890+
{
891+
"_id": "req_37fea96b211241f495fc5d09081a5045",
892+
"parentId": "fld_a06eb77e183c4727800eb7dc43ceabe1",
893+
"modified": 1602080924128,
894+
"created": 1602080883045,
895+
"url": "{{ node_url }}",
896+
"name": "eth_getRawTransactionByBlockNumberAndIndex",
897+
"description": "Returns raw transaction data of a transaction with the block number and index of which it was mined",
898+
"method": "POST",
899+
"body": {
900+
"mimeType": "application/json",
901+
"text": "{\n\t\"jsonrpc\": \"2.0\",\n \"method\": \"eth_getRawTransactionByBlockNumberAndIndex\", \n\t\"params\": [\"0x926db397ed35bedee660fe5bf6879679fa71f1fe8c27823f7f6a1e5d96a49b94\"],\n \"id\": 1\n}"
902+
},
903+
"parameters": [],
904+
"headers": [
905+
{
906+
"id": "pair_9f4d6a9dde554cd384487e04fa3b21aa",
907+
"name": "Content-Type",
908+
"value": "application/json"
909+
},
910+
{
911+
"id": "pair_088edc31f5e04f20a16b465a673871bb",
912+
"name": "Cache-Control",
913+
"value": "no-cache"
914+
}
915+
],
916+
"authentication": {},
917+
"metaSortKey": -1552732410722.5,
918+
"isPrivate": false,
919+
"settingStoreCookies": true,
920+
"settingSendCookies": true,
921+
"settingDisableRenderRequestBody": false,
922+
"settingEncodeUrl": true,
923+
"settingRebuildPath": true,
924+
"settingFollowRedirects": "global",
925+
"_type": "request"
926+
},
740927
{
741928
"_id": "req_71950018809a482da79fc927070de862",
742929
"parentId": "fld_a06eb77e183c4727800eb7dc43ceabe1",
@@ -923,12 +1110,18 @@
9231110
"modified": 1599825641645,
9241111
"created": 1552663140073,
9251112
"name": "Develop",
926-
"data": { "node_url": "http://127.0.0.1:8546" },
927-
"dataPropertyOrder": { "&": ["node_url"] },
1113+
"data": {
1114+
"node_url": "http://127.0.0.1:8546"
1115+
},
1116+
"dataPropertyOrder": {
1117+
"&": [
1118+
"node_url"
1119+
]
1120+
},
9281121
"color": null,
9291122
"isPrivate": false,
9301123
"metaSortKey": 1552663140073,
9311124
"_type": "environment"
9321125
}
9331126
]
934-
}
1127+
}

nix/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let
1717

1818
inherit (final.mantisPkgs) mantis;
1919

20-
inherit (final.mantisPkgs) mantis-unwrapped;
20+
mkSrc = import sources.nix-mksrc { inherit (final) lib; };
2121
};
2222
in import sources.nixpkgs {
2323
inherit system;

nix/pkgs/mantis/default.nix

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
{ src, lib, gitignoreSource, callPackage, jre }: rec {
2-
3-
mkSrc = src:
4-
let
5-
isGit = builtins.pathExists (src + "/.git");
6-
repo = builtins.fetchGit { url = src; submodules = true; };
7-
dirty = repo.revCount == 0;
8-
filterSrc = src:
9-
lib.cleanSourceWith {
10-
inherit src;
11-
filter = path: _: !lib.hasSuffix "nix" path;
12-
};
13-
in if isGit then
14-
if dirty then filterSrc (gitignoreSource src) else repo
15-
else
16-
src;
1+
{ src, mkSrc, lib, gitignoreSource, callPackage, jre }: rec {
172

183
mantis-source = mkSrc src;
194

nix/sources.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@
3535
"url": "https://github.com/nmattia/niv/archive/f73bf8d584148677b01859677a63191c31911eae.tar.gz",
3636
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
3737
},
38+
"nix-mksrc": {
39+
"branch": "master",
40+
"description": null,
41+
"homepage": "",
42+
"owner": "input-output-hk",
43+
"repo": "nix-mksrc",
44+
"rev": "c446c2da50209f06d75df9f06f9faa738939b54d",
45+
"sha256": "1mnp88fvg9rkl211zsg1mjkx0kk63l9q4fdy3a4avbq8z9bjb1gf",
46+
"type": "tarball",
47+
"url": "https://github.com/input-output-hk/nix-mksrc/archive/c446c2da50209f06d75df9f06f9faa738939b54d.tar.gz",
48+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
49+
},
3850
"nixkite": {
3951
"branch": "master",
4052
"description": "Nixkite is a Buildkite pipeline generation tool using the NixOS module system",

src/ets/scala/io/iohk/ethereum/ets/blockchain/Scenario.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ case class BlockHeaderDef(
5555
) {
5656

5757
def toBlockHeader: BlockHeader =
58-
BlockHeader(parentHash, uncleHash, coinbase, stateRoot, transactionsTrie, receiptTrie, bloom, difficulty, number,
59-
gasLimit, gasUsed, timestamp, extraData, mixHash, nonce, None
58+
BlockHeader(parentHash, uncleHash, coinbase, stateRoot, transactionsTrie, receiptTrie, bloom,
59+
difficulty, number, gasLimit, gasUsed, timestamp, extraData, mixHash, nonce
6060
)
6161
}
6262

src/ets/scala/io/iohk/ethereum/ets/vm/ScenarioBuilder.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ object ScenarioBuilder {
5151
env.currentTimestamp,
5252
bEmpty,
5353
bEmpty,
54-
bEmpty,
55-
None
54+
bEmpty
5655
)
5756

5857
def prepareWorld(accounts: Map[Address, AccountState], blockNumber: BigInt, exec: Exec): MockWorldState = {

src/it/scala/io/iohk/ethereum/txExecTest/util/DumpChainActor.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import akka.actor.{Actor, ActorRef, _}
77
import akka.util.ByteString
88
import io.iohk.ethereum.crypto.kec256
99
import io.iohk.ethereum.domain.{BlockBody, BlockHeader, Receipt}
10-
import io.iohk.ethereum.domain.BlockHeader._
10+
import io.iohk.ethereum.domain.BlockHeaderImplicits._
1111
import io.iohk.ethereum.network.{Peer, PeerManagerActor}
1212
import io.iohk.ethereum.network.PeerActor.SendMessage
1313
import io.iohk.ethereum.network.PeerManagerActor.{GetPeers, Peers}

src/it/scala/io/iohk/ethereum/txExecTest/util/DumpChainApp.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import io.iohk.ethereum.db.dataSource.DataSourceBatchUpdate
2626
import org.bouncycastle.util.encoders.Hex
2727

2828
import scala.concurrent.duration._
29+
import io.iohk.ethereum.domain.BlockHeader.HeaderExtraFields.HefEmpty
2930

3031
object DumpChainApp extends App with NodeKeyBuilder with SecureRandomBuilder with AuthHandshakerBuilder {
3132
val conf = ConfigFactory.load("txExecTest/chainDump.conf")
@@ -103,7 +104,7 @@ object DumpChainApp extends App with NodeKeyBuilder with SecureRandomBuilder wit
103104
class BlockchainMock(genesisHash: ByteString) extends Blockchain {
104105

105106
class FakeHeader() extends BlockHeader(ByteString.empty, ByteString.empty, ByteString.empty, ByteString.empty,
106-
ByteString.empty, ByteString.empty, ByteString.empty, 0, 0, 0, 0, 0, ByteString.empty, ByteString.empty, ByteString.empty, None) {
107+
ByteString.empty, ByteString.empty, ByteString.empty, 0, 0, 0, 0, 0, ByteString.empty, ByteString.empty, ByteString.empty, HefEmpty) {
107108
override lazy val hash: ByteString = genesisHash
108109
}
109110

@@ -162,11 +163,13 @@ object DumpChainApp extends App with NodeKeyBuilder with SecureRandomBuilder wit
162163

163164
def saveBlockNumber(number: BigInt, hash: NodeHash): Unit = ???
164165

165-
def saveBestKnownBlock(number: BigInt): Unit = ???
166+
def saveBestKnownBlocks(bestBlockNumber: BigInt, latestCheckpointNumber: Option[BigInt] = None): Unit = ???
166167

167168
def getBestBlock(): Block = ???
168169

169170
override def save(block: Block, receipts: Seq[Receipt], totalDifficulty: BigInt, saveAsBestBlock: Boolean): Unit = ???
170171

171172
override def getStateStorage: StateStorage = ???
173+
174+
override def getLatestCheckpointBlockNumber(): BigInt = ???
172175
}

src/it/scala/io/iohk/ethereum/txExecTest/util/FixtureProvider.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import java.io.Closeable
55
import akka.util.ByteString
66
import io.iohk.ethereum.db.storage._
77
import io.iohk.ethereum.domain._
8-
import io.iohk.ethereum.domain.BlockHeader._
8+
import io.iohk.ethereum.domain.BlockHeaderImplicits._
99
import io.iohk.ethereum.domain.BlockBody._
1010
import io.iohk.ethereum.network.p2p.messages.PV63._
1111
import MptNodeEncoders._

src/main/resources/application.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ mantis {
185185
}
186186

187187
# Enabled JSON-RPC APIs over the JSON-RPC endpoint
188-
# Available choices are: eth, web3, net, personal, test, daedalus, iele, qa
189-
apis = "eth,web3,net,personal,daedalus,debug,qa"
188+
# Available choices are: web3, eth, net, personal, daedalus, test, iele, debug, qa, checkpointing
189+
apis = "eth,web3,net,personal,daedalus,debug,qa,checkpointing"
190190

191191
# Maximum number of blocks for daedalus_getAccountTransactions
192192
account-transactions-max-blocks = 50000

0 commit comments

Comments
 (0)