Skip to content

Commit

Permalink
Merge pull request #5 from Retropex/addblocksizevars
Browse files Browse the repository at this point in the history
add block size/weight config options for template construction
  • Loading branch information
Retropex authored Sep 29, 2024
2 parents b046b8b + 4dd508c commit 4ee7e67
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions assets/compat/bitcoin.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,12 @@ testnet=1

{{#IF advanced.blocknotify
blocknotify={{advanced.blocknotify}}
}}

{{#IF advanced.templateconstruction.blockmaxsize
blockmaxsize={{advanced.templateconstruction.blockmaxsize}}
}}

{{#IF advanced.templateconstruction.blockmaxweight
blockmaxweight={{advanced.templateconstruction.blockmaxweight}}
}}
25 changes: 25 additions & 0 deletions scripts/services/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,31 @@ export const getConfig: T.ExpectedExports.getConfig = async (effects) => {
"Execute command when the best block changes",
warning: "You will need to restart all services that depend on Bitcoin.",
},
templateconstruction: {
type: "object",
name: "Template Construction",
description: "Set limits for block size/weight",
spec: {
blockmaxsize: {
type: "number",
name: "Max Block Size",
description: "Maximum block size in bytes",
integral: true,
range: "[100000,3985000]",
default: 3985000,
nullable: false,
},
blockmaxweight: {
type: "number",
name: "Max Block Size",
description: "Maximum block weight in vBytes",
integral: true,
range: "[100000,3985000]",
default: 3985000,
nullable: false,
},
},
},
blockfilters: {
type: "object",
name: "Block Filters",
Expand Down
7 changes: 7 additions & 0 deletions scripts/services/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ export const migration: T.ExpectedExports.migration =
config.blkconstr.mempoolexpiry = 336;
config.blkconstr.mempoolfullrbf = true;

config.advanced.templateconstruction = {
blockmaxsize : 3985000,
blockmaxweight : 3985000,
};

return config;
},
true,
Expand All @@ -272,6 +277,8 @@ export const migration: T.ExpectedExports.migration =
delete config.blkconstr.maxmempool;
delete config.blkconstr.mempoolexpiry;
delete config.blkconstr.mempoolfullrbf;
delete config.advanced.templateconstruction.blockmaxsize;
delete config.advanced.templateconstruction.blockmaxweight;

return config;
},
Expand Down

0 comments on commit 4ee7e67

Please sign in to comment.