Skip to content

Commit 5aea707

Browse files
chrisli30will-dz
andauthored
fix: Telegram subject code-wrap, migration backup path cleanup (#529)
Co-authored-by: Will Zimmerman <will@avaprotocol.org>
1 parent b173bf3 commit 5aea707

5 files changed

Lines changed: 32 additions & 49 deletions

File tree

config/aggregator.example.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@
66
environment: development
77

88
## Aggregator Server Configs
9+
# Migration backups are written to <db_path>_backup automatically.
910
db_path: /tmp/ap-avs/db
1011

11-
# Backup directory for manual backups (via REPL) and database migrations
12-
# Periodic automated backups are not currently implemented
13-
backup_dir: /tmp/ap-avs-backup
14-
1512
## Aggregator Address: Replace with your aggregator's address
1613
ecdsa_private_key:
1714

core/config/config.go

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ type Config struct {
8787
// Account abstraction config
8888
SmartWallet *SmartWalletConfig
8989

90-
BackupConfig BackupConfig
91-
9290
SocketPath string
9391
Environment sdklogging.LogLevel
9492

@@ -166,12 +164,6 @@ type SmartWalletConfig struct {
166164
MaxWalletsPerOwner int
167165
}
168166

169-
type BackupConfig struct {
170-
Enabled bool // Whether periodic backups are enabled
171-
IntervalMinutes int // Interval between backups in minutes
172-
BackupDir string // Directory to store backups
173-
}
174-
175167
// These are read from configPath
176168
type ConfigRaw struct {
177169
EcdsaPrivateKey string `yaml:"ecdsa_private_key"`
@@ -188,7 +180,6 @@ type ConfigRaw struct {
188180
AVSRegistryCoordinatorAddr string `yaml:"avs_registry_coordinator_address"`
189181

190182
DbPath string `yaml:"db_path"`
191-
BackupDir string `yaml:"backup_dir"`
192183
JwtSecret string `yaml:"jwt_secret"`
193184

194185
SmartWallet struct {
@@ -203,12 +194,6 @@ type ConfigRaw struct {
203194
MaxWalletsPerOwner int `yaml:"max_wallets_per_owner"`
204195
} `yaml:"smart_wallet"`
205196

206-
Backup struct {
207-
Enabled bool `yaml:"enabled"`
208-
IntervalMinutes int `yaml:"interval_minutes"`
209-
BackupDir string `yaml:"backup_dir"`
210-
} `yaml:"backup"`
211-
212197
SocketPath string `yaml:"socket_path"`
213198

214199
// List of approved operator addresses that can process tasks
@@ -381,11 +366,6 @@ func NewConfig(configFilePath string) (*Config, error) {
381366
configRaw.SmartWallet.MaxWalletsPerOwner = HardMaxWalletsPerOwner
382367
}
383368

384-
if configRaw.BackupDir == "" {
385-
// If backup dir is not set, use the default path, usually this path will be mount from our docker compose host
386-
configRaw.BackupDir = "/tmp/ap-avs-backup"
387-
}
388-
389369
config := &Config{
390370
EcdsaPrivateKey: ecdsaPrivateKey,
391371
Logger: logger,
@@ -406,7 +386,7 @@ func NewConfig(configFilePath string) (*Config, error) {
406386
AggregatorAddress: aggregatorAddr,
407387

408388
DbPath: configRaw.DbPath,
409-
BackupDir: configRaw.BackupDir,
389+
BackupDir: configRaw.DbPath + "_backup",
410390
JwtSecret: []byte(configRaw.JwtSecret),
411391

412392
SmartWallet: &SmartWalletConfig{
@@ -423,12 +403,6 @@ func NewConfig(configFilePath string) (*Config, error) {
423403
// PaymasterOwnerAddress will be populated below by calling owner() on the paymaster contract
424404
},
425405

426-
BackupConfig: BackupConfig{
427-
Enabled: configRaw.Backup.Enabled,
428-
IntervalMinutes: configRaw.Backup.IntervalMinutes,
429-
BackupDir: configRaw.Backup.BackupDir,
430-
},
431-
432406
SocketPath: configRaw.SocketPath,
433407
MacroVars: configRaw.Macros["vars"],
434408
MacroSecrets: configRaw.Macros["secrets"],

core/taskengine/summarizer_format_telegram.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ func getStatusEmoji(s Summary) string {
118118
}
119119
}
120120

121-
// formatSubjectWithBoldName formats the subject with <code> tags only around the workflow name
121+
// formatSubjectWithBoldName formats the subject with <code> tags around the
122+
// prefix + workflow name (everything except the trailing status suffix).
122123
// Subject patterns:
123124
// - "Simulation: {name} successfully completed"
124125
// - "Run Node: {name} succeeded"
@@ -206,13 +207,13 @@ func formatSubjectWithBoldName(subject string) string {
206207
// Extract the workflow name
207208
name := subject[nameStart:nameEnd]
208209

209-
// Build the formatted string: prefix + <code>name</code> + suffix
210+
// Build the formatted string: <code>prefix + name</code> + suffix
210211
// Using <code> prevents Telegram from auto-linking names that contain dots
211212
var sb strings.Builder
213+
sb.WriteString("<code>")
212214
if prefix != "" {
213215
sb.WriteString(html.EscapeString(prefix))
214216
}
215-
sb.WriteString("<code>")
216217
sb.WriteString(html.EscapeString(name))
217218
sb.WriteString("</code>")
218219
sb.WriteString(html.EscapeString(suffix))

core/taskengine/summarizer_format_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ func TestFormatTelegramFromStructured_PRDFormat(t *testing.T) {
782782
},
783783
},
784784
expectedContain: []string{
785-
"✅ Simulation: <code>Recurring Payment</code> successfully completed", // Only workflow name is code-wrapped
785+
"✅ <code>Simulation: Recurring Payment</code> successfully completed", // Prefix + name code-wrapped
786786
"<b>Network:</b> Sepolia",
787787
"<b>Time:</b> Jan 22, 2026 at 4:51 AM UTC",
788788
"<b>Trigger:</b> (Simulated) Your scheduled task (every 3 days at 11:00 PM) triggered on Sepolia.",
@@ -803,7 +803,7 @@ func TestFormatTelegramFromStructured_PRDFormat(t *testing.T) {
803803
},
804804
},
805805
expectedContain: []string{
806-
"✅ Run #3: <code>Recurring Payment</code> successfully completed", // Only workflow name is code-wrapped
806+
"✅ <code>Run #3: Recurring Payment</code> successfully completed", // Prefix + name code-wrapped
807807
"<b>Network:</b> Sepolia",
808808
"<b>Time:</b> Jan 22, 2026 at 4:51 AM UTC",
809809
"<b>Executed:</b>",
@@ -823,7 +823,7 @@ func TestFormatTelegramFromStructured_PRDFormat(t *testing.T) {
823823
Errors: []string{"transfer1: Insufficient balance for transfer"},
824824
},
825825
expectedContain: []string{
826-
"❌ Run #5: <code>Recurring Payment</code> failed to execute", // Only workflow name is code-wrapped
826+
"❌ <code>Run #5: Recurring Payment</code> failed to execute", // Prefix + name code-wrapped
827827
"<b>Network:</b> Sepolia",
828828
"<b>What Went Wrong:</b>",
829829
"• transfer1: Insufficient balance for transfer",
@@ -846,7 +846,7 @@ func TestFormatTelegramFromStructured_PRDFormat(t *testing.T) {
846846
},
847847
},
848848
expectedContain: []string{
849-
"⚠️ Run #2: <code>My Workflow</code> successfully completed",
849+
"⚠️ <code>Run #2: My Workflow</code> successfully completed",
850850
"<i>1 node was skipped by Branch condition.</i>",
851851
"<b>Network:</b> Ethereum",
852852
"<b>Executed:</b>",
@@ -867,7 +867,7 @@ func TestFormatTelegramFromStructured_PRDFormat(t *testing.T) {
867867
Errors: []string{"loop1 - skipped due to condition not met: `code1.data.balance >= code1.data.totalNeeded` evaluated to false"},
868868
},
869869
expectedContain: []string{
870-
"⚠️ Simulation: <code>Copy of Test Recurring Batch Send</code> successfully completed",
870+
"⚠️ <code>Simulation: Copy of Test Recurring Batch Send</code> successfully completed",
871871
"<i>1 node was skipped by Branch condition.</i>",
872872
"<b>Network:</b> Sepolia",
873873
"<b>What Went Wrong:</b>",
@@ -943,7 +943,7 @@ func TestFormatTelegramFromStructured_PRDFormat(t *testing.T) {
943943
Executions: []ExecutionEntry{{Description: "(Simulated) On-chain transaction successfully completed"}},
944944
},
945945
expectedContain: []string{
946-
"✅ Simulation: <code>My Workflow</code> successfully completed",
946+
"✅ <code>Simulation: My Workflow</code> successfully completed",
947947
"<b>Network:</b> Sepolia",
948948
"<b>Trigger:</b> (Simulated) Scheduled task ran on Sepolia",
949949
"<b>Executed:</b>",
@@ -1160,27 +1160,27 @@ func TestFormatSubjectWithBoldName(t *testing.T) {
11601160
{
11611161
name: "simulation success",
11621162
subject: "Simulation: My Workflow successfully completed",
1163-
expected: "Simulation: <code>My Workflow</code> successfully completed",
1163+
expected: "<code>Simulation: My Workflow</code> successfully completed",
11641164
},
11651165
{
11661166
name: "simulation failure",
11671167
subject: "Simulation: Test Workflow failed to execute",
1168-
expected: "Simulation: <code>Test Workflow</code> failed to execute",
1168+
expected: "<code>Simulation: Test Workflow</code> failed to execute",
11691169
},
11701170
{
11711171
name: "simulation partial",
11721172
subject: "Simulation: Another Workflow partially executed",
1173-
expected: "Simulation: <code>Another Workflow</code> partially executed",
1173+
expected: "<code>Simulation: Another Workflow</code> partially executed",
11741174
},
11751175
{
11761176
name: "run number success",
11771177
subject: "Run #3: Payment Flow successfully completed",
1178-
expected: "Run #3: <code>Payment Flow</code> successfully completed",
1178+
expected: "<code>Run #3: Payment Flow</code> successfully completed",
11791179
},
11801180
{
11811181
name: "run number failure",
11821182
subject: "Run #15: Swap Workflow failed to execute",
1183-
expected: "Run #15: <code>Swap Workflow</code> failed to execute",
1183+
expected: "<code>Run #15: Swap Workflow</code> failed to execute",
11841184
},
11851185
{
11861186
name: "no prefix success",
@@ -1195,17 +1195,17 @@ func TestFormatSubjectWithBoldName(t *testing.T) {
11951195
{
11961196
name: "workflow name with special chars",
11971197
subject: "Simulation: Copy of Recurring Payment & Report successfully completed",
1198-
expected: "Simulation: <code>Copy of Recurring Payment &amp; Report</code> successfully completed",
1198+
expected: "<code>Simulation: Copy of Recurring Payment &amp; Report</code> successfully completed",
11991199
},
12001200
{
12011201
name: "run node success",
12021202
subject: "Run Node: My Transfer succeeded",
1203-
expected: "Run Node: <code>My Transfer</code> succeeded",
1203+
expected: "<code>Run Node: My Transfer</code> succeeded",
12041204
},
12051205
{
12061206
name: "run node failure",
12071207
subject: "Run Node: My Transfer failed at transfer1",
1208-
expected: "Run Node: <code>My Transfer</code> failed at transfer1",
1208+
expected: "<code>Run Node: My Transfer</code> failed at transfer1",
12091209
},
12101210
{
12111211
name: "deployed workflow success",
@@ -1391,7 +1391,7 @@ func TestComposeSummary_SimulateTaskFromClientPayload(t *testing.T) {
13911391
telegram := FormatForMessageChannels(summary, "telegram", nil)
13921392

13931393
expectedTelegramContents := []string{
1394-
"✅ Simulation: <code>Test settings.name</code> successfully completed",
1394+
"✅ <code>Simulation: Test settings.name</code> successfully completed",
13951395
"<b>Network:</b> Sepolia",
13961396
"<b>Time:</b>",
13971397
"<b>Trigger:</b> (Simulated) Scheduled task ran on Sepolia",

docs/changes/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# EigenLayer-AVS change log
2+
3+
Long-form notes for changes worth remembering after the PR merges. Format and editorial guidance live in the `create-change-doc` Claude command (`~/.claude/commands/create-change-doc.md` locally) — this README only carries project-specific notes.
4+
5+
Filename: `YYYYMMDD-kebab-case-title.md`. Each entry opens with a header block (Date, Status, Branch, Related) and a body adapted to the change (typically Problem / Decision / Alternatives / Verification). See existing entries for examples.
6+
7+
Earlier entries (`0001-…`, `0002-…`) used a sequential four-digit prefix; those filenames are referenced from merged commits and stay as-is. New entries use the date prefix.
8+
9+
## Project-specific notes
10+
11+
_None yet. Add things here that only apply to this repo: dashboards we cross-link to, tags or prefixes we use, runbooks worth pointing at._

0 commit comments

Comments
 (0)