resolve merge conflicts with master

This commit is contained in:
Anton Evangelatov
2022-03-18 12:28:22 +01:00
194 changed files with 3519 additions and 980 deletions
+5
View File
@@ -47,6 +47,11 @@ func defCommon() Common {
ListenAddress: "/ip4/127.0.0.1/tcp/1234/http",
Timeout: Duration(30 * time.Second),
},
Logging: Logging{
SubsystemLevels: map[string]string{
"example-subsystem": "INFO",
},
},
Libp2p: Libp2p{
ListenAddresses: []string{
"/ip4/0.0.0.0/tcp/0",
+21
View File
@@ -1,3 +1,4 @@
//stm: #unit
package config
import (
@@ -12,6 +13,7 @@ import (
)
func TestDefaultFullNodeRoundtrip(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_001
c := DefaultFullNode()
var s string
@@ -32,7 +34,26 @@ func TestDefaultFullNodeRoundtrip(t *testing.T) {
require.True(t, reflect.DeepEqual(c, c2))
}
func TestDefaultFullNodeCommentRoundtrip(t *testing.T) {
c := DefaultFullNode()
var s string
{
c, err := ConfigComment(DefaultFullNode())
require.NoError(t, err)
s = string(c)
}
c2, err := FromReader(strings.NewReader(s), DefaultFullNode())
require.NoError(t, err)
fmt.Println(s)
require.True(t, reflect.DeepEqual(c, c2))
}
func TestDefaultMinerRoundtrip(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_001
c := DefaultStorageMiner()
var s string
+20
View File
@@ -127,6 +127,12 @@ of automatically performing on-chain operations.`,
Comment: ``,
},
{
Name: "Logging",
Type: "Logging",
Comment: ``,
},
{
Name: "Libp2p",
Type: "Libp2p",
@@ -484,6 +490,14 @@ count towards this limit.`,
closed by the connection manager.`,
},
},
"Logging": []DocField{
{
Name: "SubsystemLevels",
Type: "map[string]string",
Comment: `SubsystemLevels specify per-subsystem log levels`,
},
},
"MinerAddressConfig": []DocField{
{
Name: "PreCommitControl",
@@ -736,6 +750,12 @@ avoid the relatively high cost of unsealing the data later, at the cost of more
Comment: `Run sector finalization before submitting sector proof to the chain`,
},
{
Name: "MakeCCSectorsAvailable",
Type: "bool",
Comment: `After sealing CC sectors, make them available for upgrading with deals`,
},
{
Name: "CollateralFromMinerBalance",
Type: "bool",
+1 -1
View File
@@ -16,7 +16,7 @@ func findDoc(root interface{}, section, name string) *DocField {
return findDocSect("Common", section, name)
}
func findDocSect(root string, section, name string) *DocField {
func findDocSect(root, section, name string) *DocField {
path := strings.Split(section, ".")
docSection := Doc[root]
+1 -1
View File
@@ -69,7 +69,7 @@ func ConfigUpdate(cfgCur, cfgDef interface{}, comment bool) ([]byte, error) {
}
if comment {
// create a map of default lines so we can comment those out later
// create a map of default lines, so we can comment those out later
defLines := strings.Split(defStr, "\n")
defaults := map[string]struct{}{}
for i := range defLines {
+2
View File
@@ -12,6 +12,7 @@ import (
)
func TestDecodeNothing(t *testing.T) {
//stm: @NODE_CONFIG_LOAD_FILE_002
assert := assert.New(t)
{
@@ -30,6 +31,7 @@ func TestDecodeNothing(t *testing.T) {
}
func TestParitalConfig(t *testing.T) {
//stm: @NODE_CONFIG_LOAD_FILE_003
assert := assert.New(t)
cfgString := `
[API]
+14 -4
View File
@@ -13,10 +13,11 @@ import (
// Common is common config between full node and miner
type Common struct {
API API
Backup Backup
Libp2p Libp2p
Pubsub Pubsub
API API
Backup Backup
Logging Logging
Libp2p Libp2p
Pubsub Pubsub
}
// FullNode is a full node config
@@ -39,6 +40,12 @@ type Backup struct {
DisableMetadataLog bool
}
// Logging is the logging system config
type Logging struct {
// SubsystemLevels specify per-subsystem log levels
SubsystemLevels map[string]string
}
// StorageMiner is a miner config
type StorageMiner struct {
Common
@@ -243,6 +250,9 @@ type SealingConfig struct {
// Run sector finalization before submitting sector proof to the chain
FinalizeEarly bool
// After sealing CC sectors, make them available for upgrading with deals
MakeCCSectorsAvailable bool
// Whether to use available miner balance for sector collateral instead of sending it with each message
CollateralFromMinerBalance bool
// Minimum available balance to keep in the miner actor before sending it with messages