Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/check-consensus-spec-values.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
"DEPOSIT_CONTRACT_ADDRESS",
# Blob schedule - explicitly excluded
"BLOB_SCHEDULE",
# Gas limit schedule (EIP-8261) - optional field, not in upstream spec config
"GAS_LIMIT_SCHEDULE",
}


Expand Down
5 changes: 5 additions & 0 deletions config-example/cl/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ MAX_TRANSACTIONS_BYTES_PER_INCLUSION_LIST: 8192

BLOB_SCHEDULE: []

# Gas Limit Scheduling (EIP-8261)
# ---------------------------------------------------------------

GAS_LIMIT_SCHEDULE: []

# Fast Confirmation Rule
# ---------------------------------------------------------------
# 25%
Expand Down
1 change: 1 addition & 0 deletions defaults/defaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export BPO_5_EPOCH="${BPO_5_EPOCH:-18446744073709551615}"
export BPO_5_MAX_BLOBS="${BPO_5_MAX_BLOBS:-72}"
export BPO_5_TARGET_BLOBS="${BPO_5_TARGET_BLOBS:-48}"
export BPO_5_BASE_FEE_UPDATE_FRACTION="${BPO_5_BASE_FEE_UPDATE_FRACTION:-0}"
export GAS_LIMIT_SCHEDULE="${GAS_LIMIT_SCHEDULE:-[]}" # EIP-8261 GPO schedule, JSON array: [{"epoch": 256, "gas_limit": 100000000}]
export MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS="${MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:-4096}"
export MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS="${MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:-4096}"
export MIN_EPOCHS_FOR_BLOCK_REQUESTS="${MIN_EPOCHS_FOR_BLOCK_REQUESTS:-33024}"
Expand Down
41 changes: 34 additions & 7 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,27 @@ build_blob_schedule() {
fi
}

# Builds the GAS_LIMIT_SCHEDULE YAML block (EIP-8261) from the
# GAS_LIMIT_SCHEDULE env var, a JSON array of GPO entries like:
# [{"epoch": 256, "gas_limit": 100000000}, ...]
# Emits `GAS_LIMIT_SCHEDULE: []` when the array is empty.
build_gas_limit_schedule() {
local schedule_json="${GAS_LIMIT_SCHEDULE:-[]}"

if ! echo "$schedule_json" | jq -e 'type == "array" and all(.[]; (.epoch | type == "number") and (.gas_limit | type == "number"))' > /dev/null; then
echo "GAS_LIMIT_SCHEDULE must be a JSON array of {\"epoch\": <number>, \"gas_limit\": <number>} entries, got: $schedule_json" >&2
return 1
fi

if [ "$(echo "$schedule_json" | jq 'length')" -eq 0 ]; then
echo "GAS_LIMIT_SCHEDULE: []"
return
fi

echo "GAS_LIMIT_SCHEDULE:"
echo "$schedule_json" | jq -r 'sort_by(.epoch) | .[] | " - EPOCH: \(.epoch)\n GAS_LIMIT: \(.gas_limit)"'
}

gen_cl_config(){
set -x
# Consensus layer: Check if genesis already exists
Expand All @@ -97,15 +118,21 @@ gen_cl_config(){
HUMAN_READABLE_TIMESTAMP=$(date -u -d @"$GENESIS_TIMESTAMP" +"%Y-%b-%d %I:%M:%S %p %Z")
COMMENT="# $HUMAN_READABLE_TIMESTAMP"

# Build BLOB_SCHEDULE block and substitute it in place so the
# section keeps its position in the template (i.e. above the
# Fast Confirmation Rule section).
# Build the BLOB_SCHEDULE and GAS_LIMIT_SCHEDULE blocks and
# substitute them in place so each section keeps its position
# in the template.
export BLOB_SCHEDULE_YAML="$(build_blob_schedule)"
GAS_LIMIT_SCHEDULE_YAML="$(build_gas_limit_schedule)"
export GAS_LIMIT_SCHEDULE_YAML
awk '
BEGIN { new_section = ENVIRON["BLOB_SCHEDULE_YAML"] }
/^BLOB_SCHEDULE:/ { print new_section; in_blob=1; next }
in_blob && /^[[:space:]]/ { next }
{ in_blob=0; print }
BEGIN {
blob_section = ENVIRON["BLOB_SCHEDULE_YAML"]
gas_section = ENVIRON["GAS_LIMIT_SCHEDULE_YAML"]
}
/^BLOB_SCHEDULE:/ { print blob_section; in_schedule=1; next }
/^GAS_LIMIT_SCHEDULE:/ { print gas_section; in_schedule=1; next }
in_schedule && /^[[:space:]]/ { next }
{ in_schedule=0; print }
' /config/cl/config.yaml | sed 's/#HUMAN_TIME_PLACEHOLDER/'"$COMMENT"'/' > $tmp_dir/config_temp.yaml
envsubst < $tmp_dir/config_temp.yaml > /data/metadata/config.yaml

Expand Down