Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/rebase 1.3.1 #355

Merged
merged 3 commits into from
Mar 18, 2024
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
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## [Unreleased]

### Added

- Added verification to ensure CARTESI_BLOCKCHAIN_ID matches the id returned from the Ethereum node
- Added support for CARTESI_AUTH_PRIVATE_KEY and CARTESI_AUTH_PRIVATE_KEY_FILE

## [1.3.1] 2024-03-13

### Added

- Added `CARTESI_EXPERIMENTAL_SERVER_MANAGER_BYPASS_LOG` env var to allow `server-manager` output to bypass all log configuration
- Added `CARTESI_EXPERIMENTAL_DISABLE_CONFIG_LOG` env var to disable log entries related to the node's configuration

## Changed

Expand Down Expand Up @@ -349,7 +356,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Deprecated mock contracts

<!-- markdownlint-disable MD053 -->
[Unreleased]: https://github.com/cartesi/rollups-node/releases/tag/v1.3.0...HEAD
[Unreleased]: https://github.com/cartesi/rollups-node/releases/tag/v1.3.1...HEAD
[1.3.1]: https://github.com/cartesi/rollups-node/releases/tag/v1.3.1
[1.3.0]: https://github.com/cartesi/rollups-node/releases/tag/v1.3.0
[1.2.0]: https://github.com/cartesi/rollups-node/releases/tag/v1.2.0
[1.1.0]: https://github.com/cartesi/rollups-node/releases/tag/v1.1.0
Expand Down
15 changes: 15 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,21 @@ Address of the InputBox contract.

* **Type:** `string`

## `CARTESI_EXPERIMENTAL_DISABLE_CONFIG_LOG`

Disables all log entries related to the node's configuration

* **Type:** `bool`
* **Default:** `"false"`

## `CARTESI_EXPERIMENTAL_SERVER_MANAGER_BYPASS_LOG`

When enabled, prints server-manager output to stdout and stderr directly.
All other log configurations are ignored.

* **Type:** `bool`
* **Default:** `"false"`

## `CARTESI_EXPERIMENTAL_SUNODO_VALIDATOR_ENABLED`

When enabled, the node does not start the authority-claimer service and the Redis server.
Expand Down
4 changes: 4 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package config

import (
"fmt"
"io"
"log"
"os"
"strconv"
Expand Down Expand Up @@ -104,6 +105,9 @@ var configLogger = log.New(os.Stdout, "CONFIG ", log.LstdFlags)

func init() {
cache.values = make(map[string]string)
if GetCartesiExperimentalDisableConfigLog() {
configLogger.SetOutput(io.Discard)
}
}

// Reads the value of an environment variable (loads from a cached value when possible).
Expand Down
13 changes: 13 additions & 0 deletions internal/config/generate/Config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,16 @@ go-type = "string"
description = """
External Redis endpoint for the node when running in the experimental sunodo validator mode."""

[experimental.CARTESI_EXPERIMENTAL_SERVER_MANAGER_BYPASS_LOG]
default = "false"
go-type = "bool"
description = """
When enabled, prints server-manager output to stdout and stderr directly.
All other log configurations are ignored."""

[experimental.CARTESI_EXPERIMENTAL_DISABLE_CONFIG_LOG]
default = "false"
go-type = "bool"
redact = true
description = """
Disables all log entries related to the node's configuration"""
10 changes: 10 additions & 0 deletions internal/config/get.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions internal/services/server-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"net"
"os"
"os/exec"
"strconv"
"strings"
Expand Down Expand Up @@ -41,8 +42,13 @@ const waitDelay = 200 * time.Millisecond
func (s ServerManager) Start(ctx context.Context, ready chan<- struct{}) error {
cmd := exec.CommandContext(ctx, s.Path, s.Args...)
cmd.Env = s.Env
cmd.Stderr = newLineWriter(commandLogger{s.Name})
cmd.Stdout = newLineWriter(commandLogger{s.Name})
if config.GetCartesiExperimentalServerManagerBypassLog() {
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
} else {
cmd.Stderr = newLineWriter(commandLogger{s.Name})
cmd.Stdout = newLineWriter(commandLogger{s.Name})
}
// Without a delay, cmd.Wait() will block forever waiting for the I/O pipes
// to be closed
cmd.WaitDelay = waitDelay
Expand Down
Loading