This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
v0.5.0
Pre-release
Pre-release
What's Changed TL;DR
- Added support for deposits and withdrawals (mass migrations in general).
- Data returned by the API was revamped so that it's more informative and consistent throughout the methods.
- Added more API methods and removed a single unused one.
- Added commander metrics.
API Changes v0.5.0-rc2
-> v0.5.0
High-level changes
- Added and deprecated some API errors. Referer to the API error table in
api/Readme.md
for more detailed information. - Added multiple proof API methods. Refer to
docs/json_rpc.md
file for an up-to-date list of all methods. - Introduced
admin
namespace and new commander management API methods. - Introduced changes to API method results (see below).
API results changes
List of changes to data types (dto
package) returned by API methods
Batch
(used byhubble_getBatches
,hubble_getBatchByHash
andhubble_getBatchByID
methods)- New field:
Status
- string (status):"SUBMITTED"
"MINED"
(renamed from"IN_BATCH"
)"FINALIZED"
- Other:
SubmissionBlock
field was renamed toMinedBlock
and it's now optional.SubmissionTime
field renamed toMinedTime
.Commitments
field was completely revamped. See below.
- New field:
BatchCommitment
(used byhubble_getBatchByHash
andhubble_getBatchByID
methods)- Batch commitments (
Commitments
field inBatch
) were split into three different models:TxCommitment
(forTRANSFER
andCREATE2TRANSFER
batches)ID
-{BatchID: string (uint256), IndexInBatch: uint8}
objectPostStateRoot
- string (hash)LeafHash
- optional string (hash)TokenID
- string (uint256)FeeReceiverStateID
- uint32CombinedSignature
- string (signature)
MMCommitment
(forMASS_MIGRATION
batches)ID
-{BatchID: string (uint256), IndexInBatch: uint8}
objectPostStateRoot
- string (hash)LeafHash
- optional string (hash)CombinedSignature
- string (signature)WithdrawRoot
- string (hash)MassMigrationMeta
- object:SpokeID
- uint32TokenID
- string (uint256)Amount
- string (uint256)FeeReceiverStateID
- uint32
DepositCommitment
(forDEPOSIT
batches)ID
-{BatchID: string, IndexInBatch: uint8}
objectPostStateRoot
- string (hash)LeafHash
- optional string (hash)SubtreeID
- string (uint256)SubtreeRoot
- string (hash)
- Batch commitments (
Commitment
(used byhubble_getCommitment
method)- Added new
SUBMITTED
status. Currently, available statuses for commitments:"SUBMITTED"
"MINED"
(renamed from"IN_BATCH"
)"FINALIZED"
- New models for different commitment types:
TxCommitment
(forTRANSFER
andCREATE2TRANSFER
commitments)ID
-{BatchID: string (uint256), IndexInBatch: uint8}
objectType
- string (batch type)PostStateRoot
- string (hash)LeafHash
- optional string (hash)TokenID
- string (uint256)FeeReceiverStateID
- uint32CombinedSignature
- string (signature)Status
- string (status)MinedTime
- timestampTransactions
- list of transactions as objects
MMCommitment
(forMASS_MIGRATION
commitments)ID
-{BatchID: string (uint256), IndexInBatch: uint8}
objectType
- string (batch type)PostStateRoot
- string (hash)LeafHash
- optional string (hash)FeeReceiverStateID
- uint32CombinedSignature
- string (signature)Status
- string (status)MinedTime
- timestampWithdrawRoot
- string (hash)MassMigrationMeta
- object:SpokeID
- uint32TokenID
- string (uint256)Amount
- string (uint256)FeeReceiverStateID
- uint32
Transactions
- list of transactions as objects
DepositCommitment
(forDEPOSIT
commitments)ID
-{BatchID: string (uint256), IndexInBatch: uint8}
objectType
- string (batch type)PostStateRoot
- string (hash)LeafHash
- optional string (hash)Status
- string (status)MinedTime
- timestampSubtreeID
- string (uint256)SubtreeRoot
- string (hash)Deposits
- list ofDeposit
objects:ID
-{SubtreeID: string (uint256), DepositIndex: string (uint256)}
objectToPubKeyID
- uint32TokenID
- string (uint256)L2Amount
- string (uint256)
- Added new
Transaction
(used byhubble_getTransaction
method)- Renamed field:
BatchTime
->MinedTime
- Renamed field:
NetworkInfo
(used byhubble_getNetworkInfo
method)- Added new fields:
SpokeRegistry
- string (address)WithdrawManager
- string (address)
- Added new fields:
Other API changes
-
Removed
hubble_getTransactions
method. -
Added new API methods for generating proofs (see
docs/json_rpc.md
for detailed information about these methods):hubble_getUserStateProof
hubble_getPublicKeyProofByPubKeyID
hubble_getCommitmentProof
hubble_getMassMigrationCommitmentProof
hubble_getWithdrawProof
-
All API methods now support every type of batch, commitment or transaction, i.e.:
GENESIS
TRANSFER
CREATE2TRANSFER
MASS_MIGRATION
DEPOSIT
-
IN_BATCH
status was replaced withMINED
status. -
Added new
SUBMITTED
status. Seedocs/tx_statuses.png
for more details. -
hubble_sendTransactions
now acceptsMASS_MIGRATION
transactions. -
hubble_getNetworkInfo
- New output - refer to the changes made to the
NetworkInfo
data model.-
Before:
{ "ChainID": "1337", "AccountRegistry": "0x602fdcb022744cf8ae7f8b980771a541c2ecd0ce", "AccountRegistryDeploymentBlock": 72402, "TokenRegistry": "0xba984fa2c930aa3207199a89898f80f6b42579a3", "DepositManager": "0xe70c33cde3aa0b85bb4019add35b3c48c6c124f7", "Rollup": "0x07bd5a1d097e85b5025553c13d6d11ab33a7be97", "BlockNumber": 74070, "TransactionCount": 1, "AccountCount": 6, "LatestBatch": "1", "LatestFinalisedBatch": "0", "SignatureDomain": "0xcd282510ec3859813f6cc595cda9c54f5e5a8be99973c412ef1f1152a1381e59" }
-
After:
{ "ChainID": "1337", "AccountRegistry": "0x897d20d6b0c880899f8a8567c3eb47cfc338b86d", "AccountRegistryDeploymentBlock": 74218, "TokenRegistry": "0xda6761888ac7341d69430f19419be9a473bdd730", "SpokeRegistry": "0x68bfc28bd91054be2e8748edd970d96a4c7d6818", // NEW "DepositManager": "0x2afe057ac45163cd55085643b39f5fe056971bf4", "WithdrawManager": "0x60aff494251e5f86c6da382f84e785f14e8d4b9f", // NEW "Rollup": "0xc7305afbac19b486246254c181328d777ec14800", "BlockNumber": 74241, "TransactionCount": 0, "AccountCount": 6, "LatestBatch": "0", "LatestFinalisedBatch": "0", "SignatureDomain": "0xe25b2357c9a05e85a42c6dd3d53c35e9f989e3cc3df08841fb211b50d5174db0" }
-
- New output - refer to the changes made to the
-
hubble_getBatches
- Can now return
SUBMITTED
batches. - New output - refer to the changes made to the
Batch
andBatchCommitment
data models. For more detailed information
seedocs/json_rpc.md
.-
Before:
[ { "ID": "0", "Hash": "0xc0f5d8567b5407c5e8731c22a7394548be05412ec2e1a11ded083a1f6615dd57", "Type": "GENESIS", "TransactionHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "SubmissionBlock": 72424, "SubmissionTime": null, "FinalisationBlock": 72424 }, { "ID": "1", "Hash": "0x81ea5b0aeb055e9eaf89d447c045e35890178da9d22391b3baedef87cd21ae48", "Type": "TRANSFER", "TransactionHash": "0x23184ac315c1ef917cb9fb4759a329396e012c375beaa61d9fc6d45dc2a87028", "SubmissionBlock": 72518, "SubmissionTime": 1643721284, "FinalisationBlock": 112838 } ]
-
After:
[ { "ID": "0", "Hash": "0x97222c9001ff4b2e8c328d15c02fc508259f2f9bec5af8b286a932813fe920d6", "Type": "GENESIS", "TransactionHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "SubmissionBlock": 74229, "SubmissionTime": null, "Status": "FINALISED", // NEW "FinalisationBlock": 74229 }, { "ID": "1", "Hash": "0xe171252fcda69fe1ed74f68e98e109065eda83b2b196ef1c6d90c1f84a79f161", "Type": "TRANSFER", "TransactionHash": "0x7061d6f2a0fa9b62a0065307b475bd9f71bac7db1ca460c3beb4060907da6fb0", "SubmissionBlock": 74259, "SubmissionTime": 1643728275, "Status": "MINED", // NEW "FinalisationBlock": 114579 } ]
-
- Can now return
-
hubble_getBatchByID
- Can now return
SUBMITTED
batches. - See
hubble_getBatchByHash
for the new output.
- Can now return
-
hubble_getBatchByHash
- Example new output - refer to the changes made to the
Batch
andBatchCommitment
data models. For more detailed information
seedocs/json_rpc.md
.-
Before:
{ "ID": "1", "Hash": "0x81ea5b0aeb055e9eaf89d447c045e35890178da9d22391b3baedef87cd21ae48", "Type": "TRANSFER", "TransactionHash": "0x23184ac315c1ef917cb9fb4759a329396e012c375beaa61d9fc6d45dc2a87028", "SubmissionBlock": 72518, "SubmissionTime": 1643721284, "FinalisationBlock": 112838, "AccountTreeRoot": "0xb261c40259ad5dbaf32efb2256225bbf03dcda8e84cffdfe67e68b958e3c7a95", "Commitments": [ { "ID": { "BatchID": "1", "IndexInBatch": 0 }, "LeafHash": "0xb1ad9c500f7f5346f1e652b90c3dada14785da5884a5fe140f3d4c614f8aab13", "TokenID": "0", "FeeReceiverStateID": 0, "CombinedSignature": "0x1cecb356ff2d6b7b3e69e26e9fb0cf3f24edadc401bca336ca1585072c44e0880d2b2e026a056d76f81951f8b8f00a864e5e730215aff92c1915d7c233d583ec", "PostStateRoot": "0x81cf78ec55d3393ff2e9c0e081dc6ced3cd4a7e9e42f3c6e441b035035a6839a" } ] }
-
After:
{ "ID": "1", "Hash": "0xe171252fcda69fe1ed74f68e98e109065eda83b2b196ef1c6d90c1f84a79f161", "Type": "TRANSFER", "TransactionHash": "0x7061d6f2a0fa9b62a0065307b475bd9f71bac7db1ca460c3beb4060907da6fb0", "SubmissionBlock": 74259, "SubmissionTime": 1643728275, "Status": "MINED", // NEW "FinalisationBlock": 114579, "AccountTreeRoot": "0x3f4f3391a37b4af37704f81b65bb48810911bba2b8cb93394d432a7039cd310a", "Commitments": [ { "ID": { "BatchID": "1", "IndexInBatch": 0 }, "PostStateRoot": "0xae6b8d73ccfca01f6d893c59b9353b9a81bd7d0b4f6d602fc35da9fd0161ee64", "LeafHash": "0x01b561c51098a1ec53ee26d7ba61cb6db0d466028f0549d17ab95807aaadd7dc", "TokenID": "0", "FeeReceiverStateID": 0, "CombinedSignature": "0x05bde085f8950fb8f2abed736ba5c98a5ef4711c899f00b628a77a9038a3cab81d04aa4f39599edb24902dad56c8d2a0400dfb7dd7ab86bb6fd406b0aa5a0160" } ] }
-
- Example new output - refer to the changes made to the
-
hubble_getCommitment
- Can now return
SUBMITTED
commitments. - Example new output - refer to the changes made to the
Commitment
data model. For more detailed information seedocs/json_rpc.md
.-
Before:
{ "ID": { "BatchID": "1", "IndexInBatch": 0 }, "Type": "TRANSFER", "FeeReceiver": 0, "CombinedSignature": "0x19a2c5c759859042e061366357e977170dd34f203a155495d9c5b80383e9dbfe041d5b451eeed06bfd7c24c54be41884a35d82ad35ab9e7c80764092aa21ac3f", "PostStateRoot": "0x81cf78ec55d3393ff2e9c0e081dc6ced3cd4a7e9e42f3c6e441b035035a6839a", "Status": "IN_BATCH", "BatchTime": 1643728199, "Transactions": [ { "Hash": "0x9b442316136f46247a399169aff5b9931060331f4b66971766a81b77765cfb36", "FromStateID": 1, "Amount": "50", "Fee": "1", "Nonce": "0", "Signature": "0x19a2c5c759859042e061366357e977170dd34f203a155495d9c5b80383e9dbfe041d5b451eeed06bfd7c24c54be41884a35d82ad35ab9e7c80764092aa21ac3f", "ReceiveTime": 1643728197, "ToStateID": 2 } ] }
-
After:
{ "ID": { "BatchID": "1", "IndexInBatch": 0 }, "Type": "TRANSFER", "PostStateRoot": "0xae6b8d73ccfca01f6d893c59b9353b9a81bd7d0b4f6d602fc35da9fd0161ee64", "LeafHash": "0x01b561c51098a1ec53ee26d7ba61cb6db0d466028f0549d17ab95807aaadd7dc", // NEW "TokenID": "0", // NEW "FeeReceiverStateID": 0, // RENAMED "CombinedSignature": "0x05bde085f8950fb8f2abed736ba5c98a5ef4711c899f00b628a77a9038a3cab81d04aa4f39599edb24902dad56c8d2a0400dfb7dd7ab86bb6fd406b0aa5a0160", "Status": "MINED", "BatchTime": 1643728275, "Transactions": [ { "Hash": "0x9b442316136f46247a399169aff5b9931060331f4b66971766a81b77765cfb36", "FromStateID": 1, "Amount": "50", "Fee": "1", "Nonce": "0", "Signature": "0x05bde085f8950fb8f2abed736ba5c98a5ef4711c899f00b628a77a9038a3cab81d04aa4f39599edb24902dad56c8d2a0400dfb7dd7ab86bb6fd406b0aa5a0160", "ReceiveTime": 1643728272, "ToStateID": 2 } ] }
-
- Can now return
-
hubble_getTransaction
- Can now return transactions of all statuses:
"PENDING"
"SUBMITTED"
"MINED"
(renamed from"IN_BATCH"
)"FINALIZED"
"ERROR"
- Can now return transactions of all statuses:
Commits
- Remove deployment configs and Postman envs by @msieczko in #396
- Dispute C2Ts sent to nonexistent accounts by @b-tarczynski in #390
- Make eth package methods use WaitToBeMined instead of event watchers by @duckception in #347
- Add sending C2T to the benchmark by @marik-d in #370
- Fix e2e bench setup and teardown by @marik-d in #404
- Create syncDeposits method by @duckception in #324
- Make Commitment table in badger support both tx and deposit commitments by @b-tarczynski in #401
- Fix creating commitments when all transactions fail by @msieczko in #410
- Suppress Geth output in E2E tests by @msieczko in #411
- Rollback RollupContext transaction on RollupErrors and store invalid transaction errors by @duckception in #416
- Make CreateCommitments handle min/max params correctly by @msieczko in #415
- Optimise WaitToBeMined calls in test by @b-tarczynski in #414
- Use session builders in eth client by @b-tarczynski in #417
- Remove redundant api/README.md by @duckception in #413
- Run E2E in-process on push to master by @marik-d in #405
- Add state and commitment proof endpoints by @lucasege in #387
- Fix nonce validation in sendTransaction API method by @msieczko in #406
- Run E2E tests and benchmarks in separate jobs by @msieczko in #419
- Make deploy subcommand use its own config file by @duckception in #399
- Don't crash on transfers to nonexistent recipients by @msieczko in #422
- Add eth_call after dispute transaction failed by @b-tarczynski in #420
- Implement ExecuteInTransaction on Database by @b-tarczynski in #418
- Query all pending transaction once in rollup loop by @b-tarczynski in #426
- Refactor config loading code by @msieczko in #430
- Handle unhandled errors in sendTransaction API endpoint by @duckception in #412
- Sort hubble_getUserStates result array by StateID by @b-tarczynski in #428
- Skip transactions with too high nonce by @b-tarczynski in #427
- Ignore internal transactions when syncing tokens by @duckception in #432
- Enable mixed benchmarks by @msieczko in #433
- Set min txs per commitment to 1 for benchmarks run on master by @msieczko in #435
- Enable linter for hardhat and e2e tests by @msieczko in #434
- Document standard errors returned by JSON-RPC API by @duckception in #436
- Remove Transactions from TxCommitment struct by @b-tarczynski in #437
- Submit deposit batches in rollup loop by @b-tarczynski in #431
- Rename transferError to txError by @b-tarczynski in #439
- Add E2E benchmark for public key registration by @duckception in #438
- Optimize contracts deployment by @msieczko in #441
- Add state diagrams of transaction statuses by @msieczko in #442
- Add a diagram of a data structure for in-memory transaction processing by @msieczko in #443
- Split benchmarks into multiple jobs on CI by @duckception in #445
- Fix index on ToStateID field of StoredTxReceipt by @msieczko in #447
- Store txs errors outside rollup loop by @b-tarczynski in #449
- Slim TransactionExecutor and TransactionSyncer by @b-tarczynski in #450
- Sync deposit batches by @b-tarczynski in #446
- Bump Go version to 1.17 by @duckception in #453
- Add metrics to commander API by @duckception in #444
- Add a diagram of data structures used in Rollup loop by @msieczko in #454
- Update docs of data structures stored in Badger by @msieczko in #455
- Add rollup loop metrics by @duckception in #451
- Add syncing metrics by @duckception in #456
- Fix index on CommitmentID field of StoredTxReceipt by @msieczko in #457
- Add test for deposit batch syncing by @b-tarczynski in #452
- Add blockchain calls metrics by @duckception in #458
- Add E2E test for deposit batches by @b-tarczynski in #459
- Update running instructions in README.md by @msieczko in #464
- Extract TxQueue struct by @marik-d in #462
- Update contracts to v0.12.0 by @msieczko in #461
- Add methods for storing MassMigration transactions by @duckception in #463
- Fix index on ToStateID field of StoredTx by @msieczko in #465
- Add statistics on operations done in long-running Badger txs by @msieczko in #469
- Update the primary key of PendingDeposits table by @max-sidorov in #471
- Accept and store MassMigration transactions in the API by @duckception in #466
- Don't index batches with nil hashes by @msieczko in #468
- Allow syncing a transfer from and to the same state ID by @max-sidorov in #467
- Handle deposit rollbacks by @b-tarczynski in #460
- Make rollup loop build and submit mass migration batches by @duckception in #470
- Decrease MemTableSize param in Badger by @msieczko in #448
- Fix Makefile benchmark targets by @lithp in #474
- Close workers safely on errors by @max-sidorov in #472
- Sync mass migration batches by @b-tarczynski in #476
- Return error or panic instead of using log.Fatal by @msieczko in #477
- Remove duplicated tests for
CreateCommitments
by @max-sidorov in #475 - Move Stored* types from
models
to a newstored
package by @max-sidorov in #473 - Add notes on SC upgradability approaches by @msieczko in #482
- Check iterator errors when filtering logs by @max-sidorov in #483
- Optimize Rollup loop to avoid unnecessary
RevertTo
calls by @msieczko in #486 - Support mass migration transactions in all API endpoints by @duckception in #478
- Return dto type instead of
interface{}
fromGetTransaction
by @msieczko in #488 - Add mass migration E2E test by @duckception in #479
- Make all C2T benchmarks register public keys by @duckception in #480
- Remove nonexistent CI job dependency by @b-tarczynski in #491
- Deploy and setup WithdrawManager by @duckception in #484
- Add benchmarks for mass migrations by @duckception in #481
- Refactor
CreateCommitments
tests suites by @max-sidorov in #485 - Remove nonce validation and support tx replacement by @msieczko in #492
- Handle MassMigration disputes by @b-tarczynski in #489
- Remove redundant check from tokens sync by @msieczko in #495
- Setup mdBook by @max-sidorov in #490
- Refactor fraud proof tests in disputer package by @b-tarczynski in #493
- Use plugin to automatically generate table of contents in mdBook by @max-sidorov in #498
- Simplify dispute tests in commander package by @b-tarczynski in #500
- Allow for failed txs replacement by @b-tarczynski in #501
- Make
dto
types not depend onmodels
types by @max-sidorov in #494 - Update contracts to 0.12.1 by @b-tarczynski in #502
- Store registered spokes in Badger by @max-sidorov in #496
- Sync spokes by @max-sidorov in #499
- Validate spokeID in hubble_sendTransaction by @max-sidorov in #497
- Add SDK methods for signing and verification by @philsippl in #504
- Cover missing dispute cases with tests by @b-tarczynski in #503
- Add E2E tests for MassMigration disputes by @b-tarczynski in #505
- Measure MassMigration disputes gas usage by @b-tarczynski in #506
- Rename MM batch submission gas limit config option by @msieczko in #509
- Add
SpokeRegistry
fromChainState
in missing places by @duckception in #513 - Refactor E2E dispute tests and remove redundant ones by @msieczko in #510
- Remove hubble_getTransactions API method by @msieczko in #515
- Remove indices on stored.Tx and profile benchmarks by @msieczko in #514
- Upgrade contracts to v0.13.0 by @duckception in #518
- Upgrade badgerhold to v4.0.3 (0898ce32287b) by @b-tarczynski in #520
- Add proof endpoints for withdrawal process by @duckception in #508
- Add E2E withdraw test by @duckception in #511
- Add RollupConfig.MaxTxnDelay by @lithp in #507
- Drop Some Duplicated Code by @lithp in #521
- Add statistics for MassMigration batch operations by @b-tarczynski in #522
- Make subtree naming consistent by @b-tarczynski in #523
- Fix a typo and an example request in Postman collection by @msieczko in #524
- Deduplicate logic around MarkTransactionsAsIncluded by @lithp in #525
- Remove obsolete State Tree data schema analysis from docs by @msieczko in #529
- Store MassMigration specific commitment details in Badger by @duckception in #530
- Register token and transfer genesis funds during contract deployment by @b-tarczynski in #528
- Make GetRevertMessage method public by @duckception in #533
- Use stable image of ethereum/client-go in CI by @b-tarczynski in #535
- Add command to export user states by @b-tarczynski in #532
- Modify genesis format to include user state data by @b-tarczynski in #531
- Add command to export accounts by @b-tarczynski in #534
- Remove unused tx with batch details structures by @lithp in #539
- Add authentication by key passed to config by @b-tarczynski in #541
- Add proper support to API for all batch and commitment types by @duckception in #537
- Deduplicate fee receiver field in MassMigration commitment by @b-tarczynski in #544
- Withdraw proposer stakes by @max-sidorov in #512
- Add documentation for withdrawals flow by @duckception in #546
- Add batch statuses to API endpoints by @duckception in #540
- Add MMCommitmentBody data structure to documentation by @duckception in #551
- Use config search paths, standardize docker container by @recmo in #543
- Add code coverage by @recmo in #549
- Commander always syncs from initial block when bootstrapping via remote node URL by @max-sidorov in #545
- Add
getPendingBatches
API method by @b-tarczynski in #538 - Don't index public keys added to fill incomplete account registration batches by @msieczko in #555
- Add ThreadSanitizer by @recmo in #550
- Add new
SUBMITTED
status to API by @duckception in #556 - Remove deposits field from Batch returned by GetBatchBy* API endpoints by @duckception in #557
- Require explicit passing of genesis file to deploy commander by @duckception in #558
- Add configure API method by @marik-d in #536
- Keep track of blockchain txs that commander sends and crash on revert by @max-sidorov in #542
- Rename
dto.PendingDeposit
todto.Deposit
by @duckception in #560 - Use urfave/cli for hubble commands by @b-tarczynski in #559
- Extract rollupControls and workers structs from Commander by @msieczko in #561
- Rename some fields to better fit in with new
SUBMITTED
status by @duckception in #565
New Contributors
- @max-sidorov made their first contribution in #471
- @lithp made their first contribution in #474
Full Changelog: v0.5.0-rc2...v0.5.0