Skip to content

Commit

Permalink
feat: make anchoring fast by default (#191)
Browse files Browse the repository at this point in the history
* feat: make anchoring fast by default

When keramik is used to deploy CAS it is only in the context of a
hermetic testing env. Therefore we can assume that anchoring should be
as fast as possible in order to all for faster tests etc.

Makes two changes:

1. Reduces worker delay to 1s instead of 1m after completing a batch.
2. Configures ganache to instantly mine any transaction.

* tests
  • Loading branch information
nathanielc committed Jun 25, 2024
1 parent 27202e1 commit c8f34aa
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
7 changes: 6 additions & 1 deletion operator/src/network/cas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ pub fn cas_stateful_set_spec(
value: Some("false".to_owned()),
..Default::default()
},
EnvVar {
name: "SCHEDULER_INTERVAL_MS".to_owned(),
value: Some("1000".to_owned()),
..Default::default()
},
],
]
.concat(),
Expand Down Expand Up @@ -648,7 +653,7 @@ pub fn ganache_stateful_set_spec(
command: Some([
"node",
"/app/dist/node/cli.js",
"--miner.blockTime=5",
"--miner.blockTime=0",
"--mnemonic='move sense much taxi wave hurry recall stairs thank brother nut woman'",
"--networkId=5777",
"-l=80000000",
Expand Down
12 changes: 6 additions & 6 deletions operator/src/network/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2858,8 +2858,8 @@ mod tests {
"name": "cas-api",
"ports": [
{
@@ -272,8 +272,8 @@
"value": "false"
@@ -276,8 +276,8 @@
"value": "1000"
}
],
- "image": "ceramicnetwork/ceramic-anchor-service:latest",
Expand All @@ -2869,7 +2869,7 @@ mod tests {
"name": "cas-worker",
"resources": {
"limits": {
@@ -442,8 +442,8 @@
@@ -446,8 +446,8 @@
"value": "dev"
}
],
Expand Down Expand Up @@ -2976,7 +2976,7 @@ mod tests {
"ephemeral-storage": "1Gi",
"memory": "1Gi"
}
@@ -277,12 +277,12 @@
@@ -281,12 +281,12 @@
"name": "cas-worker",
"resources": {
"limits": {
Expand All @@ -2991,7 +2991,7 @@ mod tests {
"ephemeral-storage": "1Gi",
"memory": "1Gi"
}
@@ -365,12 +365,12 @@
@@ -369,12 +369,12 @@
"name": "cas-scheduler",
"resources": {
"limits": {
Expand All @@ -3006,7 +3006,7 @@ mod tests {
"ephemeral-storage": "1Gi",
"memory": "1Gi"
}
@@ -470,7 +470,7 @@
@@ -474,7 +474,7 @@
],
"resources": {
"requests": {
Expand Down
4 changes: 4 additions & 0 deletions operator/src/network/testdata/default_stubs/cas_stateful_set
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ Request {
{
"name": "SCHEDULER_STOP_AFTER_NO_OP",
"value": "false"
},
{
"name": "SCHEDULER_INTERVAL_MS",
"value": "1000"
}
],
"image": "ceramicnetwork/ceramic-anchor-service:latest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Request {
"command": [
"node",
"/app/dist/node/cli.js",
"--miner.blockTime=5",
"--miner.blockTime=0",
"--mnemonic='move sense much taxi wave hurry recall stairs thank brother nut woman'",
"--networkId=5777",
"-l=80000000",
Expand Down

0 comments on commit c8f34aa

Please sign in to comment.