@@ -516,7 +516,7 @@ func (l2 *L2) processBlock(ctx context.Context, blockNumber uint64) error {
516516 flashtestationsTxCount ++
517517 builderTxCount ++
518518 }
519-
519+
520520 if l2 .cfg .MonitorBuilderPolicyContract != "" && l2 .isBuilderPolicyAddWorkloadIdTx (tx ) {
521521 go func () {
522522 l2 .handleAddWorkloadIdTx (ctx , tx .Hash ())
@@ -1180,6 +1180,7 @@ func (l2 *L2) handleAddWorkloadIdTx(ctx context.Context, txHash ethcommon.Hash)
11801180 zap .Error (err ),
11811181 zap .String ("tx" , txHash .Hex ()),
11821182 )
1183+ return
11831184 }
11841185
11851186 if receipt .Status == ethtypes .ReceiptStatusFailed {
@@ -1191,9 +1192,13 @@ func (l2 *L2) handleAddWorkloadIdTx(ctx context.Context, txHash ethcommon.Hash)
11911192
11921193 for _ , log := range receipt .Logs {
11931194 if len (log .Topics ) > 1 && log .Topics [0 ] == l2 .builderPolicyAddWorkloadIdEventSignature {
1194- workloadId := ethcommon .BytesToAddress (log .Topics [1 ].Bytes ())
1195+ // workloadId is bytes32 (32 bytes), stored directly in Topics[1]
1196+ // log.Topics[1] is a common.Hash which is [32]byte
1197+ workloadId := [32 ]byte (log .Topics [1 ])
1198+
11951199 l .Info ("Workload added to policy" ,
11961200 zap .String ("workloadId" , hex .EncodeToString (workloadId [:])),
1201+ zap .String ("tx" , txHash .Hex ()),
11971202 )
11981203 metrics .WorkloadAddedToPolicyCount .Record (ctx , 1 , otelapi .WithAttributes (
11991204 attribute.KeyValue {Key : "kind" , Value : attribute .StringValue ("l2" )},
@@ -1204,7 +1209,9 @@ func (l2 *L2) handleAddWorkloadIdTx(ctx context.Context, txHash ethcommon.Hash)
12041209 }
12051210 }
12061211
1207- return
1212+ l .Warn ("WorkloadAddedToPolicy event not found in transaction" ,
1213+ zap .String ("tx" , txHash .Hex ()),
1214+ )
12081215}
12091216
12101217// Extract TEE address and raw quote from TEEServiceRegistered event
0 commit comments