AI prompts
base on # Monad Execution
## Overview
This repository contains the execution component of a Monad node. It
handles the transaction processing for new blocks, and keeps track of
the state of the blockchain. Consequently, this repository contains
the source code for Category Labs' custom
[EVM implementation](https://docs.monad.xyz/monad-arch/execution/native-compilation),
its [database implementation](https://docs.monad.xyz/monad-arch/execution/monaddb),
and the high-level [transaction scheduling](https://docs.monad.xyz/monad-arch/execution/parallel-execution).
The other main repository is [monad-bft](https://github.com/category-labs/monad-bft),
which contains the source code for the consensus component.
## Building the source code
### Package requirements
Execution has two kinds of dependencies on third-party libraries:
1. **Self-managed**: execution's CMake build system will checkout most of
its third-party dependencies as git submodules, and build them as part
of its own build process, as CMake subprojects; this will happen
automatically during the build, but you must run:
```shell
git submodule update --init --recursive
```
after checking out this repository.
2. **System**: some dependencies are expected to already be part of the
system in a default location, i.e., they are expected to come from the
system's package manager. The primary development platform is Ubuntu, so
the required packages use the Debian/Ubuntu package names; an up-to-date
list of the required system dependencies can be found in the docker
configuration file `docker/release.Dockerfile` (you will need all
the packages installed via the `apt install` commands)
### Minimum development tool requirements
- gcc-15 or clang-19
- CMake 3.27
- Even when using clang, the only standard library supported is libstdc++;
libc++ may work but it is not a tested platform
### CPU compilation requirements
As explained in the [hardware requirements](https://docs.monad.xyz/monad-arch/hardware-requirements),
a Monad node requires a relatively recent CPU. Execution explicitly
requires this to compile: it needs to emit machine code that is only
supported on recent CPU models, for fast cryptographic operations.
The minimum ISA support corresponds to the [x86-64-v3](https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels)
feature level. Consequently, the minimum flag you must pass to the compiler
is `-march=x86-64-v3`, or alternatively `-march=haswell` ("Haswell" was
the codename of the first Intel CPU to support all of these features).
You may also pass any higher architecture level if you wish, although
the compiled binary may not work on older CPUs. The execution docker
files use `-march=haswell` because it tries to maximize the number of
systems the resulting binary can run on. If you are only running locally
(i.e., the binary does not need to run anywhere else) use `-march=native`.
### Compiling the execution code
First, change your working directory to the root directory of the execution
git repository root and then run:
```shell
CC=gcc-15 CXX=g++-15 CFLAGS="-march=haswell" CXXFLAGS="-march=haswell" ASMFLAGS="-march=haswell" \
./scripts/configure.sh && ./scripts/build.sh
```
The above command will do several things:
- Use gcc-15 instead of the system's default compiler
- Emit machine code using Haswell-era CPU extensions
- Run CMake, and generate a [ninja](https://ninja-build.org/) build
system in the `<path-to-execution-repo>/build` directory with
the [`CMAKE_BUILD_TYPE`](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html)
set to `RelWithDebInfo` by default
- Build the CMake `all` target, which builds everything
The compiler and CPU options are injected via environment variables that
are read by CMake. If you want debug binaries instead, you can also pass
`CMAKE_BUILD_TYPE=Debug` via the environment.
When finished, this will build all of the execution binaries. The main one is
the execution daemon, `build/cmd/monad`. This binary can provide block
execution services for different EVM-compatible blockchains:
- When used as part of a Monad blockchain node, it behaves as the block
execution service for the Category Labs consensus daemon (for details, see
[here](docs/overview.md#how-is-execution-used)); when running in this mode,
Monad EVM extensions (e.g., Monad-style staking) are enabled
- It can also replay the history of other EVM-compatible blockchains, by
executing their historical blocks as inputs; a common developer workflow
(and a good full system test) is to replay the history of the original
Ethereum mainnet and verify that the computed Merkle roots match after
each block
You can also run the full test suite in parallel with:
```
CTEST_PARALLEL_LEVEL=$(nproc) ctest
```
## A tour of execution
To understand how the source code is organized, you should start by reading
the execution [developer overview](docs/overview.md), which explains how
execution and consensus fit together, and where in the source tree you can
find different pieces of functionality.
", Assign "at most 3 tags" to the expected json: {"id":"14898","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"