OpenAtomFoundation / xupercore

The kernel of xuperchain.
Apache License 2.0
61 stars 47 forks source link

add update system config contracts #444

Closed superlitian closed 8 months ago

superlitian commented 1 year ago

UpdateGasPrice

usage

{
    "args" : {
        "min_vote_percent": "51", 
        "stop_vote_height": "20" 
    },
    "trigger": {
        "height": 25, 
        "module": "xkernel",
        "contract": "$updateConfig",
        "method": "updateGasPrice",
        "args" : {
            "gas_price": {
                "cpu_rate": 1,
                "mem_rate": 1,
                "disk_rate": 2,
                "xfee_rate": 2
            }
        }
    }
}

UpdateMaxBlockSize

usage

{
    "args" : {
        "min_vote_percent": "51", 
        "stop_vote_height": "20" 
    },
    "trigger": {
        "height": 25, 
        "module": "xkernel",
        "contract": "$updateConfig",
        "method": "updateMaxBlockSize",
        "args" : {
            "maxBlockSize":  12222222
        }
    }
}

rollBackUpdateGasPrice and rollBackUpdateMaxBlockSize 保证区块回滚时数据一起回滚。

codecov-commenter commented 1 year ago

Codecov Report

Merging #444 (471a206) into master (b8e9ea8) will decrease coverage by 1.37%. The diff coverage is 29.72%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #444      +/-   ##
==========================================
- Coverage   46.28%   44.91%   -1.37%     
==========================================
  Files         142      145       +3     
  Lines       12721    13060     +339     
==========================================
- Hits         5888     5866      -22     
- Misses       5658     5999     +341     
- Partials     1175     1195      +20     
Impacted Files Coverage Δ
bcs/consensus/pow/common.go 77.41% <ø> (ø)
bcs/consensus/pow/pow.go 42.96% <ø> (ø)
bcs/consensus/single/single.go 48.10% <0.00%> (ø)
bcs/consensus/tdpos/common.go 55.07% <ø> (ø)
bcs/consensus/tdpos/kernel_contract.go 25.49% <ø> (ø)
bcs/consensus/tdpos/schedule.go 42.98% <ø> (-0.91%) :arrow_down:
bcs/consensus/tdpos/tdpos.go 47.88% <ø> (-2.35%) :arrow_down:
bcs/consensus/xpoa/kernel_contract.go 58.53% <ø> (ø)
bcs/ledger/xledger/ledger/genesis.go 41.33% <ø> (ø)
bcs/ledger/xledger/ledger/ledger.go 56.44% <ø> (ø)
... and 36 more

... and 9 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more