Skip to content

A limit of mass deposits in a single Propose transaction #382

@sifnoc

Description

@sifnoc

Currently, the massDeposits which are not included are over 300 in testnet. That was accumulated by long periods of absent coordinators activity. That is a low possible scenario in zkopru protocol in production. Anyway, It happened in testnet and we should be considered that.

The error log shows what happens over the limit of size massDeposits can be included in one Propose tx.

[1647770286864] INFO (3505 on 51f58fd1afd8): Picked txs: 0
[1647770286864] INFO (3505 on 51f58fd1afd8): Pending txs: 0
[1647770286880] INFO (3505 on 51f58fd1afd8): Trying to create a child block of 0xa69837df7fd12f315b8c1fac35ec7146d9114c0a6ccbd0771e8755da5229fd07
[1647770286887] ERROR (3505 on 51f58fd1afd8): Uncaught error in task
[1647770286888] ERROR (3505 on 51f58fd1afd8): Exceeds the given buffer size
    Error: Exceeds the given buffer size
        at hexToBuffer (/src/packages/utils/dist/index.js:123:15)
        at Object.numToBuffer (/src/packages/utils/dist/index.js:174:12)
        at serializeMassDeposits (/src/packages/core/dist/block/utils.js:128:39)
        at Object.serializeBody (/src/packages/core/dist/block/utils.js:157:9)
        at Coordinator.<anonymous> (/src/packages/coordinator/dist/coordinator.js:286:24)
        at Generator.next (<anonymous>)
        at fulfilled (/src/packages/coordinator/dist/coordinator.js:5:58)
[1647770286898] ERROR (3505 on 51f58fd1afd8): coordinator/coordinator.ts - Error occurred during block proposing: Error: Exceeds the given buffer size

Only 255 massDeposits can be included in a single Propose transaction.

const massDepositLenBytes = Utils.numToBuffer(massDeposits.length, 1)

That is possible to happen error in withdrawals MassMigrations. I am not calculating yet. the one inflow, two outflows type of zktxs maximally included around 222, #343 (comment)
That means it possibly over 255 withdrawals zkTx if all zktx has massmigration with 1 inflow 1 outflow type in single propose transaction.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions