Skip to content

Rollup node: automatically execute outbox messages

Alain Mebsout requested to merge alain@functori@execute-outbox-auto into master

What

This MR makes the rollup node execute outbox message of its rollup automatically (when configured to do so).

Why

The UX for executing outbox messages (e.g. for withdrawals in Etherlink) is a bit clunky and relies on external tools (https://docs.etherlink.com/building-on-etherlink/bridging-xtz#withdrawal-process). This MR makes rollup nodes execute them automatically but it must pay the fees.

How

Using !14498 (merged).

Relevant configuration fields: fee-parameters, execute-outbox-messages-filter.

Example configuration

{
  "fee-parameters" : { 
    "execute_outbox_message" :  { 
      "fee-cap" : "1000000",
      "burn-cap" : "1000000",
    }
  },
  "execute-outbox-messages-filter" : [
    {"transaction" : { "destination": ["KT1EJPTNDAap8MdroeuA9kqquXtVp9KtHySy", "tz1RK72RVLV9N5B8hLgVHCZVAYeydUsqtrfm"], 
                       "entrypoint": "any"}},
    {"transaction" : { "entrypoint": ["default", "mint"], 
                       "destination": "any"}},
    {
      "transaction": {
        "destination": [
          "KT1CeFqjJRJPNVvhvznQrWfHad2jCiDZ6Lyj"
        ],
        "entrypoint": [
          "burn"
        ]
      }
    }
  ]
}

This will make the rollup node execute all outbox messages whose destination is KT1EJPTNDAap8MdroeuA9kqquXtVp9KtHySy or tz1RK72RVLV9N5B8hLgVHCZVAYeydUsqtrfm, or whose entrypoint is either default or mint (independently of destination). It will also execute outbox messages which call the entrypoint burn of KT1CeFqjJRJPNVvhvznQrWfHad2jCiDZ6Lyj.

Only message which consume less that 1 tez in fees and which burn less than 1 tez in storage will be executed though.

Once can use the following to execute all outbox message:

{ 
  "execute-outbox-messages-filter" : [ { 
     "transaction" : {
       "destination" : "any", 
       "entrypoint" : "any"
     } 
   } ] 
}

Manually testing the MR

dune exec tezt/tests/main.exe -- -f sc_rollup.ml "title =~ auto_execute_outbox"

Rollup node running with this patch in production on mainnet Etherlink : https://tzkt.io/tz1QQAPf4v6ApPx9AteMa3ZV2kTiBT6x16Ps/operations

Edited by Alain Mebsout

Merge request reports

Loading