-
Notifications
You must be signed in to change notification settings - Fork 12
feat(cli): validator container runs with cartesi unprivileged user #152
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
Closed
endersonmaia
wants to merge
4
commits into
prerelease/v2-alpha
from
feature/run-validator-with-unprivileged-user
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5585479
feat(cli): adapt to rollups-node:2.0.0
endersonmaia 87f8b78
DELETE: use cartesi/rollups-node:devel
endersonmaia d2c37a4
chore(cli): bump sdk to 0.12.0-alpha.5
endersonmaia 61ab946
feat(cli): validator container runs with cartesi unprivileged user
endersonmaia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@cartesi/cli": patch | ||
| --- | ||
|
|
||
| validator container will run with cartesi unprivileged user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM cartesi/rollups-node:1.5.1 | ||
| FROM cartesi/rollups-node:devel | ||
| ENV CARTESI_SNAPSHOT_DIR=/usr/share/rollups-node/snapshot | ||
| ENV CARTESI_HTTP_ADDRESS=0.0.0.0 | ||
| COPY --chown=cartesi:cartesi . ${CARTESI_SNAPSHOT_DIR} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,46 @@ | ||
| # cartesi/rollups-node | ||
| CARTESI_LOG_LEVEL="${CARTESI_LOG_LEVEL:-error}" | ||
| CARTESI_HTTP_ADDRESS="${CARTESI_HTTP_ADDRESS:-0.0.0.0}" | ||
| CARTESI_HTTP_PORT="${CARTESI_HTTP_PORT:-10000}" | ||
| CARTESI_FEATURE_HOST_MODE="${CARTESI_FEATURE_HOST_MODE:-false}" | ||
| CARTESI_FEATURE_READER_MODE_ENABLED="${CARTESI_FEATURE_READER_MODE_ENABLED:-false}" | ||
| CARTESI_FEATURE_DISABLE_CLAIMER="${CARTESI_FEATURE_DISABLE_CLAIMER:-false}" | ||
| CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK="${CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK:-true}" | ||
|
|
||
| #logs | ||
| CARTESI_LOG_LEVEL="${CARTESI_LOG_LEVEL:-info}" | ||
| CARTESI_LOG_PRETTY_ENABLED="${CARTESI_LOG_PRETTY_ENABLED:-false}" | ||
|
|
||
| # features | ||
| CARTESI_FEATURE_INPUT_READER_ENABLED="${CARTESI_FEATURE_INPUT_READER_ENABLED:-true}" | ||
| CARTESI_FEATURE_CLAIM_SUBMISSION_ENABLED="${CARTESI_FEATURE_CLAIM_SUBMISSION_ENABLED:-true}" | ||
| CARTESI_FEATURE_MACHINE_HASH_CHECK_ENABLED="${CARTESI_FEATURE_MACHINE_HASH_CHECK_ENABLED:-false}" | ||
|
|
||
| # rollups | ||
| CARTESI_EPOCH_LENGTH="${CARTESI_EPOCH_LENGTH:-720}" | ||
| CARTESI_EVM_READER_RETRY_POLICY_MAX_RETRIES="${CARTESI_EVM_READER_RETRY_POLICY_MAX_RETRIES:-3}" | ||
| CARTESI_EVM_READER_RETRY_POLICY_MAX_DELAY="${CARTESI_EVM_READER_RETRY_POLICY_MAX_DELAY:-3}" | ||
| CARTESI_ADVANCER_POLLING_INTERVAL="${CARTESI_ADVANCER_POLLING_INTERVAL:-7}" | ||
| CARTESI_VALIDATOR_POLLING_INTERVAL="${CARTESI_VALIDATOR_POLLING_INTERVAL:-7}" | ||
| CARTESI_CLAIMER_POLLING_INTERVAL="${CARTESI_CLAIMER_POLLING_INTERVAL:-7}" | ||
| CARTESI_MAX_STARTUP_TIME="${CARTESI_MAX_STARTUP_TIME:-5}" | ||
|
|
||
| # blockchain | ||
| CARTESI_BLOCKCHAIN_ID="${CARTESI_BLOCKCHAIN_ID:-31337}" | ||
| CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anvil:8545}" | ||
| CARTESI_BLOCKCHAIN_WS_ENDPOINT="${CARTESI_BLOCKCHAIN_WS_ENDPOINT:-ws://anvil:8545}" | ||
| CARTESI_BLOCKCHAIN_IS_LEGACY="${CARTESI_BLOCKCHAIN_IS_LEGACY:-false}" | ||
| CARTESI_BLOCKCHAIN_FINALITY_OFFSET="${CARTESI_BLOCKCHAIN_FINALITY_OFFSET:-0}" | ||
| CARTESI_LEGACY_BLOCKCHAIN_ENABLED="${CARTESI_LEGACY_BLOCKCHAIN_ENABLED:-false}" | ||
| CARTESI_EVM_READER_DEFAULT_BLOCK="${CARTESI_EVM_READER_DEFAULT_BLOCK:-latest}" | ||
| CARTESI_BLOCKCHAIN_BLOCK_TIMEOUT="${CARTESI_BLOCKCHAIN_BLOCK_TIMEOUT:-60}" | ||
| CARTESI_CONTRACTS_APPLICATION_ADDRESS="${CARTESI_CONTRACTS_APPLICATION_ADDRESS:-0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e}" | ||
| CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER="${CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER:-22}" | ||
| CARTESI_CONTRACTS_HISTORY_ADDRESS="${CARTESI_CONTRACTS_HISTORY_ADDRESS:-0x325272217ae6815b494bf38ced004c5eb8a7cda7}" | ||
| CARTESI_CONTRACTS_AUTHORITY_ADDRESS="${CARTESI_CONTRACTS_AUTHORITY_ADDRESS:-0x58c93f83fb3304730c95aad2e360cdb88b782010}" | ||
| CARTESI_CONTRACTS_INPUT_BOX_ADDRESS="${CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:-0x59b22D57D4f067708AB0c00552767405926dc768}" | ||
| CARTESI_SNAPSHOT_DIR="${CARTESI_SNAPSHOT_DIR:-/usr/share/cartesi/snapshot}" | ||
|
|
||
| # contracts | ||
| CARTESI_CONTRACTS_INPUT_BOX_ADDRESS="${CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:-0x593E5BCf894D6829Dd26D0810DA7F064406aebB6}" | ||
| CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER="${CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER:-7}" | ||
| CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS="${CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS:-0xd7d4d184b82b1a4e08f304DDaB0A2A7a301C2620}" | ||
| CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS="${CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS:-0xB897F7Fe78f220aE34B7FA9493092701a873Ed45}" | ||
|
|
||
| # snapshot | ||
| CARTESI_SNAPSHOT_DIR="${CARTESI_SNAPSHOT_DIR:-/usr/share/rollups-node/snapshot}" | ||
|
|
||
| # auth | ||
| CARTESI_AUTH_MNEMONIC="${CARTESI_AUTH_MNEMONIC:-test test test test test test test test test test test junk}" | ||
| CARTESI_POSTGRES_ENDPOINT="${CARTESI_POSTGRES_ENDPOINT:-postgres://postgres:password@database:5432/postgres}" | ||
| CARTESI_EXPERIMENTAL_SERVER_MANAGER_BYPASS_LOG="${CARTESI_EXPERIMENTAL_SERVER_MANAGER_BYPASS_LOG:-false}" | ||
|
|
||
| # server-manager | ||
| SM_DEADLINE_MACHINE="${SM_DEADLINE_MACHINE:-30000}" | ||
| # postgres | ||
| CARTESI_POSTGRES_ENDPOINT="${CARTESI_POSTGRES_ENDPOINT:-postgres://postgres:password@database:5432/postgres?sslmode=disable}" | ||
|
|
||
| # http | ||
| CARTESI_INSPECT_PORT=${CARTESI_INSPECT_PORT:-10012} | ||
| CARTESI_INSPECT_ADDRESS=${CARTESI_INSPECT_ADDRESS:-0.0.0.0:$CARTESI_INSPECT_PORT} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This busy wait and coordination between the
commandandpost_startis not very elegant.Does it really need to be this way? What if the
post_startfails for whatever reason?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add some timeout to ensure it fails.
It's my approach to run the validator with an unprivileged user leveraging compose.
There are other approaches, for sure, would have to test some alternatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we first see how the
start+deploywould work. Because it will be different in that case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, we can put this on-hold
if the rollups-node container image release already has this in-place, this process or preparing a directory should just be unnecessary