Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

v0.5.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@msieczko msieczko released this 04 Feb 10:06
· 98 commits to master since this release
1d73448

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 by hubble_getBatches, hubble_getBatchByHash and hubble_getBatchByID methods)
    • New field:
      • Status - string (status):
        • "SUBMITTED"
        • "MINED" (renamed from "IN_BATCH")
        • "FINALIZED"
    • Other:
      • SubmissionBlock field was renamed to MinedBlock and it's now optional.
      • SubmissionTime field renamed to MinedTime.
      • Commitments field was completely revamped. See below.
  • BatchCommitment (used by hubble_getBatchByHash and hubble_getBatchByID methods)
    • Batch commitments (Commitments field in Batch) were split into three different models:
      • TxCommitment (for TRANSFER and CREATE2TRANSFER batches)
        • ID - {BatchID: string (uint256), IndexInBatch: uint8} object
        • PostStateRoot - string (hash)
        • LeafHash - optional string (hash)
        • TokenID - string (uint256)
        • FeeReceiverStateID - uint32
        • CombinedSignature - string (signature)
      • MMCommitment (for MASS_MIGRATION batches)
        • ID - {BatchID: string (uint256), IndexInBatch: uint8} object
        • PostStateRoot - string (hash)
        • LeafHash - optional string (hash)
        • CombinedSignature - string (signature)
        • WithdrawRoot - string (hash)
        • MassMigrationMeta- object:
          • SpokeID - uint32
          • TokenID - string (uint256)
          • Amount - string (uint256)
          • FeeReceiverStateID - uint32
      • DepositCommitment (for DEPOSIT batches)
        • ID - {BatchID: string, IndexInBatch: uint8} object
        • PostStateRoot - string (hash)
        • LeafHash - optional string (hash)
        • SubtreeID - string (uint256)
        • SubtreeRoot - string (hash)
  • Commitment (used by hubble_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 (for TRANSFER and CREATE2TRANSFER commitments)
        • ID - {BatchID: string (uint256), IndexInBatch: uint8} object
        • Type - string (batch type)
        • PostStateRoot - string (hash)
        • LeafHash - optional string (hash)
        • TokenID - string (uint256)
        • FeeReceiverStateID - uint32
        • CombinedSignature - string (signature)
        • Status - string (status)
        • MinedTime - timestamp
        • Transactions - list of transactions as objects
      • MMCommitment (for MASS_MIGRATION commitments)
        • ID - {BatchID: string (uint256), IndexInBatch: uint8} object
        • Type - string (batch type)
        • PostStateRoot - string (hash)
        • LeafHash - optional string (hash)
        • FeeReceiverStateID - uint32
        • CombinedSignature - string (signature)
        • Status - string (status)
        • MinedTime - timestamp
        • WithdrawRoot - string (hash)
        • MassMigrationMeta- object:
          • SpokeID - uint32
          • TokenID - string (uint256)
          • Amount - string (uint256)
          • FeeReceiverStateID - uint32
        • Transactions - list of transactions as objects
      • DepositCommitment (for DEPOSIT commitments)
        • ID - {BatchID: string (uint256), IndexInBatch: uint8} object
        • Type - string (batch type)
        • PostStateRoot - string (hash)
        • LeafHash - optional string (hash)
        • Status - string (status)
        • MinedTime - timestamp
        • SubtreeID - string (uint256)
        • SubtreeRoot - string (hash)
        • Deposits - list of Deposit objects:
          • ID - {SubtreeID: string (uint256), DepositIndex: string (uint256)} object
          • ToPubKeyID - uint32
          • TokenID - string (uint256)
          • L2Amount - string (uint256)
  • Transaction (used by hubble_getTransaction method)
    • Renamed field:
      • BatchTime -> MinedTime
  • NetworkInfo (used by hubble_getNetworkInfo method)
    • Added new fields:
      • SpokeRegistry - string (address)
      • WithdrawManager - string (address)

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 with MINED status.

  • Added new SUBMITTED status. See docs/tx_statuses.png for more details.

  • hubble_sendTransactions now accepts MASS_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"
        }
  • hubble_getBatches

    • Can now return SUBMITTED batches.
    • New output - refer to the changes made to the Batch and BatchCommitment data models. For more detailed information
      see docs/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
            }
        ]
  • hubble_getBatchByID

    • Can now return SUBMITTED batches.
    • See hubble_getBatchByHash for the new output.
  • hubble_getBatchByHash

    • Example new output - refer to the changes made to the Batch and BatchCommitment data models. For more detailed information
      see docs/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"
                }
            ]
        }
  • hubble_getCommitment

    • Can now return SUBMITTED commitments.
    • Example new output - refer to the changes made to the Commitment data model. For more detailed information see docs/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
                }
            ]
        }
  • hubble_getTransaction

    • Can now return transactions of all statuses:
      • "PENDING"
      • "SUBMITTED"
      • "MINED" (renamed from "IN_BATCH")
      • "FINALIZED"
      • "ERROR"

Commits

New Contributors

Full Changelog: v0.5.0-rc2...v0.5.0