From 981bfc69cf16e7338212610cb8f664717069b709 Mon Sep 17 00:00:00 2001 From: Vinh Date: Tue, 17 Dec 2024 08:13:00 -0800 Subject: [PATCH 01/19] delete the stale task storage once status changed --- core/taskengine/executor.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/taskengine/executor.go b/core/taskengine/executor.go index bfff77cd..b482751a 100644 --- a/core/taskengine/executor.go +++ b/core/taskengine/executor.go @@ -74,6 +74,8 @@ func (x *TaskExecutor) Perform(job *apqueue.Job) error { func (x *TaskExecutor) RunTask(task *model.Task, triggerMetadata *avsproto.TriggerMetadata) (*avsproto.Execution, error) { vm, err := NewVMWithData(task.Id, triggerMetadata, task.Nodes, task.Edges) + initialTaskStatus := task.Status + if err != nil { return nil, fmt.Errorf("vm failed to initialize: %w", err) } @@ -128,6 +130,13 @@ func (x *TaskExecutor) RunTask(task *model.Task, triggerMetadata *avsproto.Trigg x.logger.Errorf("error updating task status. %w", err, "task_id", task.Id) } + // whenever a task change its status, we moved it, therefore we will need to clean up the old storage + if task.Status != initialTaskStatus { + if err = x.db.Delete(TaskStorageKey(task.Id, initialTaskStatus)); err != nil { + x.logger.Errorf("error updating task status. %w", err, "task_id", task.Id) + } + } + if runTaskErr == nil { x.logger.Info("succesfully executing task", "task_id", task.Id, "triggermark", triggerMetadata) return execution, nil From 40906669fe09728b455776d286bcdb4735e3086a Mon Sep 17 00:00:00 2001 From: Vinh Date: Tue, 17 Dec 2024 12:22:12 -0800 Subject: [PATCH 02/19] support fetching data for multiple account/workflow --- aggregator/rpc_server.go | 4 +- core/taskengine/cursor.go | 42 +++- core/taskengine/engine.go | 112 +++++++--- core/taskengine/engine_test.go | 186 ++++++++++++++++ core/taskengine/errors.go | 3 + core/taskengine/testutil.go | 1 - core/testutil/utils.go | 66 ++++++ examples/decode-create-account.js | 15 ++ examples/encode-create-account.js | 6 + examples/example.js | 10 +- examples/static_codegen/avs_pb.js | 160 +++++++++++--- examples/util.js | 18 ++ protobuf/avs.pb.go | 346 ++++++++++++++++-------------- protobuf/avs.proto | 6 +- storage/db.go | 20 ++ 15 files changed, 771 insertions(+), 224 deletions(-) delete mode 100644 core/taskengine/testutil.go create mode 100644 examples/decode-create-account.js create mode 100644 examples/encode-create-account.js create mode 100644 examples/util.js diff --git a/aggregator/rpc_server.go b/aggregator/rpc_server.go index f728b0df..e00ddf02 100644 --- a/aggregator/rpc_server.go +++ b/aggregator/rpc_server.go @@ -157,6 +157,7 @@ func (r *RpcServer) ListTasks(ctx context.Context, payload *avsproto.ListTasksRe r.config.Logger.Info("process list task", "user", user.Address.String(), "smart_wallet_address", payload.SmartWalletAddress, + "cursor", payload.Cursor, ) return r.engine.ListTasksByUser(user, payload) } @@ -169,7 +170,8 @@ func (r *RpcServer) ListExecutions(ctx context.Context, payload *avsproto.ListEx r.config.Logger.Info("process list execution", "user", user.Address.String(), - "task_id", payload.Id, + "task_id", payload.TaskIds, + "cursor", payload.Cursor, ) return r.engine.ListExecutions(user, payload) } diff --git a/core/taskengine/cursor.go b/core/taskengine/cursor.go index 963d30a2..8ffd69ff 100644 --- a/core/taskengine/cursor.go +++ b/core/taskengine/cursor.go @@ -33,6 +33,10 @@ func CursorFromString(data string) (*Cursor, error) { ulidPos: ulid.Zero, } + if data == "" { + return c, nil + } + decoded, err := base64.StdEncoding.DecodeString(data) if err != nil { return c, err @@ -54,6 +58,11 @@ func NewCursor(direction CursorDirection, position string) *Cursor { int64Pos: 0, } } + +func (c *Cursor) IsZero() bool { + return c.Position == "0" +} + func (c *Cursor) String() string { var d []byte d, err := json.Marshal(c) @@ -68,7 +77,7 @@ func (c *Cursor) String() string { } // Given a value, return true if the value is after the cursor -func (c *Cursor) AfterInt64(value int64) bool { +func (c *Cursor) LessThanInt64(value int64) bool { if !c.parsePos { c.int64Pos, _ = strconv.ParseInt(c.Position, 10, 64) c.parsePos = true @@ -81,7 +90,7 @@ func (c *Cursor) AfterInt64(value int64) bool { } // Given a value, return true if the value is after the cursor -func (c *Cursor) AfterUlid(value ulid.ULID) bool { +func (c *Cursor) LessThanUlid(value ulid.ULID) bool { if !c.parsePos { var err error c.ulidPos, err = ulid.Parse(c.Position) @@ -95,3 +104,32 @@ func (c *Cursor) AfterUlid(value ulid.ULID) bool { } return c.ulidPos.Compare(value) > 0 } + +// Given a value, return true if the value is after the cursor +func (c *Cursor) LessThanOrEqualInt64(value int64) bool { + if !c.parsePos { + c.int64Pos, _ = strconv.ParseInt(c.Position, 10, 64) + c.parsePos = true + } + if c.Direction == CursorDirectionNext { + return c.int64Pos <= value + } + + return c.int64Pos >= value +} + +// Given a value, return true if the value is after the cursor +func (c *Cursor) LessThanOrEqualUlid(value ulid.ULID) bool { + if !c.parsePos { + var err error + c.ulidPos, err = ulid.Parse(c.Position) + if err != nil { + c.ulidPos = ulid.Zero + } + c.parsePos = true + } + if c.Direction == CursorDirectionNext { + return c.ulidPos.Compare(value) <= 0 + } + return c.ulidPos.Compare(value) >= 0 +} diff --git a/core/taskengine/engine.go b/core/taskengine/engine.go index c6665cb5..cfb35f3c 100644 --- a/core/taskengine/engine.go +++ b/core/taskengine/engine.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "math/big" + "slices" "strconv" "sync" "time" @@ -235,6 +236,10 @@ func (n *Engine) CreateSmartWallet(user *model.User, payload *avsproto.GetWallet sender, err := aa.GetSenderAddressForFactory(rpcConn, user.Address, factoryAddress, salt) + if err != nil || sender.Hex() == "0x0000000000000000000000000000000000000000" { + return nil, status.Errorf(codes.InvalidArgument, InvalidFactoryAddressError) + } + wallet := &model.SmartWallet{ Owner: &user.Address, Address: sender, @@ -390,29 +395,41 @@ func (n *Engine) AggregateChecksResult(address string, payload *avsproto.NotifyT } func (n *Engine) ListTasksByUser(user *model.User, payload *avsproto.ListTasksReq) (*avsproto.ListTasksResp, error) { - // by default show the task from the default smart wallet, if proving we look into that wallet specifically - owner := user.SmartAccountAddress - if payload.SmartWalletAddress == "" { + if len(payload.SmartWalletAddress) == 0 { return nil, status.Errorf(codes.InvalidArgument, MissingSmartWalletAddressError) } - if !ValidWalletAddress(payload.SmartWalletAddress) { - return nil, status.Errorf(codes.InvalidArgument, InvalidSmartAccountAddressError) - } + prefixes := make([]string, len(payload.SmartWalletAddress)) + for i, smartWalletAddress := range payload.SmartWalletAddress { + if smartWalletAddress == "" { + return nil, status.Errorf(codes.InvalidArgument, MissingSmartWalletAddressError) + } - if valid, _ := ValidWalletOwner(n.db, user, common.HexToAddress(payload.SmartWalletAddress)); !valid { - return nil, status.Errorf(codes.InvalidArgument, InvalidSmartAccountAddressError) - } + if !ValidWalletAddress(smartWalletAddress) { + return nil, status.Errorf(codes.InvalidArgument, InvalidSmartAccountAddressError) + } - smartWallet := common.HexToAddress(payload.SmartWalletAddress) - owner = &smartWallet + if valid, _ := ValidWalletOwner(n.db, user, common.HexToAddress(smartWalletAddress)); !valid { + return nil, status.Errorf(codes.InvalidArgument, InvalidSmartAccountAddressError) + } - taskIDs, err := n.db.GetByPrefix(SmartWalletTaskStoragePrefix(user.Address, *owner)) + smartWallet := common.HexToAddress(smartWalletAddress) + prefixes[i] = string(SmartWalletTaskStoragePrefix(user.Address, smartWallet)) + } + //taskIDs, err := n.db.GetByPrefix(SmartWalletTaskStoragePrefix(user.Address, *owner)) + taskKeys, err := n.db.ListKeysMulti(prefixes) if err != nil { return nil, grpcstatus.Errorf(codes.Code(avsproto.Error_StorageUnavailable), StorageUnavailableError) } + // second, do the sort, this is key sorted by ordering of ther insertion + slices.SortFunc(taskKeys, func(a, b string) int { + id1 := ulid.MustParse(string(model.TaskKeyToId([]byte(a[2:])))) + id2 := ulid.MustParse(string(model.TaskKeyToId([]byte(b[2:])))) + return id1.Compare(id2) + }) + taskResp := &avsproto.ListTasksResp{ Items: []*avsproto.ListTasksResp_Item{}, Cursor: "", @@ -421,15 +438,25 @@ func (n *Engine) ListTasksByUser(user *model.User, payload *avsproto.ListTasksRe total := 0 cursor, err := CursorFromString(payload.Cursor) itemPerPage := int(payload.ItemPerPage) + if itemPerPage < 0 { + } if itemPerPage == 0 { itemPerPage = DefaultItemPerPage } - for _, kv := range taskIDs { - status, _ := strconv.Atoi(string(kv.Value)) - taskID := string(model.TaskKeyToId(kv.Key[2:])) + + visited := 0 + for i := len(taskKeys) - 1; i >= 0; i-- { + key := taskKeys[i] + visited = i + taskID := string(model.TaskKeyToId(([]byte(key[2:])))) + statusValue, err := n.db.GetKey([]byte(key)) + if err != nil { + return nil, grpcstatus.Errorf(codes.Code(avsproto.Error_StorageUnavailable), StorageUnavailableError) + } + status, _ := strconv.Atoi(string(statusValue)) taskIDUlid := model.UlidFromTaskId(taskID) - if !cursor.AfterUlid(taskIDUlid) { + if !cursor.IsZero() && cursor.LessThanOrEqualUlid(taskIDUlid) { continue } @@ -470,6 +497,7 @@ func (n *Engine) ListTasksByUser(user *model.User, payload *avsproto.ListTasksRe if total >= itemPerPage { taskResp.Cursor = NewCursor(CursorDirectionNext, taskResp.Items[total-1].Id).String() } + taskResp.HasMore = visited > 0 return taskResp, nil } @@ -557,16 +585,31 @@ func (n *Engine) TriggerTask(user *model.User, payload *avsproto.UserTriggerTask // List Execution for a given task id func (n *Engine) ListExecutions(user *model.User, payload *avsproto.ListExecutionsReq) (*avsproto.ListExecutionsResp, error) { - task, err := n.GetTaskByID(payload.Id) - if err != nil { - return nil, err + // Validate all tasks own by the caller + for _, id := range payload.TaskIds { + task, err := n.GetTaskByID(id) + if err != nil { + return nil, grpcstatus.Errorf(codes.NotFound, TaskNotFoundError) + } + + if !task.OwnedBy(user.Address) { + return nil, grpcstatus.Errorf(codes.NotFound, TaskNotFoundError) + } } - if !task.OwnedBy(user.Address) { - return nil, grpcstatus.Errorf(codes.NotFound, TaskNotFoundError) + prefixes := make([]string, len(payload.TaskIds)) + for _, id := range payload.TaskIds { + prefixes = append(prefixes, string(TaskExecutionPrefix(id))) } - executionKVs, err := n.db.GetByPrefix(TaskExecutionPrefix(task.Id)) + executionKeys, err := n.db.ListKeysMulti(prefixes) + + // second, do the sort, this is key sorted by ordering of ther insertion + slices.SortFunc(executionKeys, func(a, b string) int { + id1 := ulid.MustParse(string(ExecutionIdFromStorageKey([]byte(a)))) + id2 := ulid.MustParse(string(ExecutionIdFromStorageKey([]byte(b)))) + return id1.Compare(id2) + }) if err != nil { return nil, grpcstatus.Errorf(codes.Code(avsproto.Error_StorageUnavailable), StorageUnavailableError) @@ -580,18 +623,34 @@ func (n *Engine) ListExecutions(user *model.User, payload *avsproto.ListExecutio total := 0 cursor, err := CursorFromString(payload.Cursor) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, InvalidCursor) + } + itemPerPage := int(payload.ItemPerPage) + if itemPerPage < 0 { + return nil, status.Errorf(codes.InvalidArgument, InvalidPaginationParam) + } + if itemPerPage == 0 { itemPerPage = DefaultItemPerPage } - for _, kv := range executionKVs { - executionUlid := ulid.MustParse(string(ExecutionIdFromStorageKey(kv.Key))) - if !cursor.AfterUlid(executionUlid) { + visited := 0 + for i := len(executionKeys) - 1; i >= 0; i-- { + key := executionKeys[i] + visited = i + executionUlid := ulid.MustParse(ExecutionIdFromStorageKey([]byte(key))) + if !cursor.IsZero() && cursor.LessThanOrEqualUlid(executionUlid) { + continue + } + + executionValue, err := n.db.GetKey([]byte(key)) + if err != nil { continue } exec := avsproto.Execution{} - if err := protojson.Unmarshal(kv.Value, &exec); err == nil { + if err := protojson.Unmarshal(executionValue, &exec); err == nil { executioResp.Items = append(executioResp.Items, &exec) total += 1 } @@ -603,6 +662,7 @@ func (n *Engine) ListExecutions(user *model.User, payload *avsproto.ListExecutio if total >= itemPerPage { executioResp.Cursor = NewCursor(CursorDirectionNext, executioResp.Items[total-1].Id).String() } + executioResp.HasMore = visited > 0 return executioResp, nil } diff --git a/core/taskengine/engine_test.go b/core/taskengine/engine_test.go index 4566ba7c..4c576a7b 100644 --- a/core/taskengine/engine_test.go +++ b/core/taskengine/engine_test.go @@ -1 +1,187 @@ package taskengine + +import ( + "fmt" + "testing" + + "github.com/AvaProtocol/ap-avs/core/testutil" + avsproto "github.com/AvaProtocol/ap-avs/protobuf" + "github.com/AvaProtocol/ap-avs/storage" +) + +func TestListTasks(t *testing.T) { + db := testutil.TestMustDB() + defer storage.Destroy(db.(*storage.BadgerStorage)) + //defer db.Close() + + config := testutil.GetAggregatorConfig() + n := New(db, config, nil, testutil.GetLogger()) + n.CreateSmartWallet(testutil.TestUser1(), &avsproto.GetWalletReq{ + Salt: "12345", + }) + n.CreateSmartWallet(testutil.TestUser1(), &avsproto.GetWalletReq{ + Salt: "6789", + }) + + // Now create a test task + tr1 := testutil.RestTask() + tr1.Memo = "t1" + // salt 0 + tr1.SmartWalletAddress = "0x7c3a76086588230c7B3f4839A4c1F5BBafcd57C6" + n.CreateTask(testutil.TestUser1(), tr1) + + tr2 := testutil.RestTask() + tr2.Memo = "t2" + // salt 12345 + tr2.SmartWalletAddress = "0x961d2DD008960A9777571D78D21Ec9C3E5c6020c" + n.CreateTask(testutil.TestUser1(), tr2) + + tr3 := testutil.RestTask() + // salt 6789 + tr3.Memo = "t3" + tr3.SmartWalletAddress = "0x5D36dCdB35D0C85D88C5AA31E37cac165B480ba4" + n.CreateTask(testutil.TestUser1(), tr3) + + result, err := n.ListTasksByUser(testutil.TestUser1(), &avsproto.ListTasksReq{ + SmartWalletAddress: []string{"0x5D36dCdB35D0C85D88C5AA31E37cac165B480ba4"}, + }) + + if err != nil { + t.Errorf("expect list task succesfully but got error %s", err) + } + + if len(result.Items) != 1 { + t.Errorf("list task return wrong. expect 1, got %d", len(result.Items)) + } + if result.Items[0].Memo != "t3" { + t.Errorf("list task return wrong. expect memo t1, got %s", result.Items[0].Memo) + } + + result, err = n.ListTasksByUser(testutil.TestUser1(), &avsproto.ListTasksReq{ + SmartWalletAddress: []string{ + "0x7c3a76086588230c7B3f4839A4c1F5BBafcd57C6", + "0x961d2DD008960A9777571D78D21Ec9C3E5c6020c", + }, + }) + + if len(result.Items) != 2 { + t.Errorf("list task returns wrong. expect 2, got %d", len(result.Items)) + } + if result.Items[0].Memo != "t2" && result.Items[1].Memo != "t1" { + t.Errorf("list task returns wrong data. expect t2, t1 got %s, %s", result.Items[0].Memo, result.Items[1].Memo) + } +} + +func TestListTasksPagination(t *testing.T) { + db := testutil.TestMustDB() + defer storage.Destroy(db.(*storage.BadgerStorage)) + //defer db.Close() + + config := testutil.GetAggregatorConfig() + n := New(db, config, nil, testutil.GetLogger()) + n.CreateSmartWallet(testutil.TestUser1(), &avsproto.GetWalletReq{ + Salt: "12345", + }) + n.CreateSmartWallet(testutil.TestUser1(), &avsproto.GetWalletReq{ + Salt: "6789", + }) + + // Firs we setup test for a 3 smart walets, with overlap ordering + // Now create a test task + tr1 := testutil.RestTask() + tr1.Memo = "t1" + // salt 0 + tr1.SmartWalletAddress = "0x7c3a76086588230c7B3f4839A4c1F5BBafcd57C6" + n.CreateTask(testutil.TestUser1(), tr1) + + tr2 := testutil.RestTask() + tr2.Memo = "t2_1" + // salt 12345 + tr2.SmartWalletAddress = "0x961d2DD008960A9777571D78D21Ec9C3E5c6020c" + n.CreateTask(testutil.TestUser1(), tr2) + + for i := range 20 { + tr3 := testutil.RestTask() + // salt 6789 + tr3.Memo = fmt.Sprintf("t3_%d", i) + tr3.SmartWalletAddress = "0x5D36dCdB35D0C85D88C5AA31E37cac165B480ba4" + n.CreateTask(testutil.TestUser1(), tr3) + } + + tr2 = testutil.RestTask() + tr2.Memo = "t2_2" + // salt 12345 + tr2.SmartWalletAddress = "0x961d2DD008960A9777571D78D21Ec9C3E5c6020c" + n.CreateTask(testutil.TestUser1(), tr2) + + // Now we start to list task of a list of smart wallet, assert that result doesn't contains tasks of other wallet, ordering and pagination follow cursor should return right data too + result, err := n.ListTasksByUser(testutil.TestUser1(), &avsproto.ListTasksReq{ + SmartWalletAddress: []string{ + "0x961d2DD008960A9777571D78D21Ec9C3E5c6020c", + "0x5D36dCdB35D0C85D88C5AA31E37cac165B480ba4", + }, + ItemPerPage: 5, + }) + + if err != nil { + t.Errorf("expect list task succesfully but got error %s", err) + } + + if !result.HasMore { + t.Errorf("expect hasmore is true, but got false") + } + + if len(result.Items) != 5 { + t.Errorf("list task returns wrong. expect 5, got %d", len(result.Items)) + } + if result.Items[0].Memo != "t2_2" { + t.Errorf("list task returns first task wrong. expect task t2, got %s", result.Items[0].Memo) + } + + if result.Items[2].Memo != "t3_18" || result.Items[4].Memo != "t3_16" { + t.Errorf("list task returns wrong task result, expected t3_19 t3_17 got %s %s", result.Items[2].Memo, result.Items[4].Memo) + } + + if result.Cursor == "" { + t.Errorf("list task returns wrong cursor. expect non empty, got none") + } + result, err = n.ListTasksByUser(testutil.TestUser1(), &avsproto.ListTasksReq{ + SmartWalletAddress: []string{ + "0x961d2DD008960A9777571D78D21Ec9C3E5c6020c", + "0x5D36dCdB35D0C85D88C5AA31E37cac165B480ba4", + }, + ItemPerPage: 15, + Cursor: result.Cursor, + }) + + if len(result.Items) != 15 { + t.Errorf("list task returns wrong. expect 15, got %d", len(result.Items)) + } + if result.Items[0].Memo != "t3_15" || result.Items[2].Memo != "t3_13" || result.Items[14].Memo != "t3_1" { + t.Errorf("list task returns wrong task result, expected t3_15 t3_13 t3_1 got %s %s %s", result.Items[0].Memo, result.Items[2].Memo, result.Items[14].Memo) + } + + if !result.HasMore { + t.Errorf("expect hasmore is true, but got false") + } + + result, err = n.ListTasksByUser(testutil.TestUser1(), &avsproto.ListTasksReq{ + SmartWalletAddress: []string{ + "0x961d2DD008960A9777571D78D21Ec9C3E5c6020c", + "0x5D36dCdB35D0C85D88C5AA31E37cac165B480ba4", + }, + ItemPerPage: 15, + Cursor: result.Cursor, + }) + + if len(result.Items) != 2 { + t.Errorf("list task returns wrong. expect 2, got %d", len(result.Items)) + } + if result.Items[0].Memo != "t3_0" || result.Items[1].Memo != "t2_1" { + t.Errorf("list task returns wrong task result, expected t3_15 t3_1 got %s %s", result.Items[0].Memo, result.Items[1].Memo) + } + if result.HasMore { + t.Errorf("expect hasmore is false, but got true") + } + +} diff --git a/core/taskengine/errors.go b/core/taskengine/errors.go index f943e040..f9aed325 100644 --- a/core/taskengine/errors.go +++ b/core/taskengine/errors.go @@ -18,4 +18,7 @@ const ( TaskStorageCorruptedError = "task data storage is corrupted" TaskIDMissing = "Missing task id in request" + + InvalidCursor = "cursor is not valid" + InvalidPaginationParam = "item per page is not valid" ) diff --git a/core/taskengine/testutil.go b/core/taskengine/testutil.go deleted file mode 100644 index 4566ba7c..00000000 --- a/core/taskengine/testutil.go +++ /dev/null @@ -1 +0,0 @@ -package taskengine diff --git a/core/testutil/utils.go b/core/testutil/utils.go index f26c0bc6..bd177625 100644 --- a/core/testutil/utils.go +++ b/core/testutil/utils.go @@ -7,11 +7,15 @@ import ( "os" "time" + avsproto "github.com/AvaProtocol/ap-avs/protobuf" + sdklogging "github.com/Layr-Labs/eigensdk-go/logging" "github.com/allegro/bigcache/v3" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" + "github.com/AvaProtocol/ap-avs/core/config" + "github.com/AvaProtocol/ap-avs/model" "github.com/AvaProtocol/ap-avs/storage" ) @@ -69,6 +73,7 @@ func TestMustDB() storage.Storage { if err != nil { panic(err) } + //dir = "/tmp/ap-avs" db, err := storage.NewWithPath(dir) if err != nil { panic(err) @@ -76,6 +81,36 @@ func TestMustDB() storage.Storage { return db } +func GetLogger() sdklogging.Logger { + logger, err := sdklogging.NewZapLogger("development") + if err != nil { + panic(err) + } + return logger +} + +func TestUser1() *model.User { + address := common.HexToAddress("0xD7050816337a3f8f690F8083B5Ff8019D50c0E50") + smartWalletAddress := common.HexToAddress("0x7c3a76086588230c7B3f4839A4c1F5BBafcd57C6") + + return &model.User{ + Address: address, + // Factory https://sepolia.etherscan.io/address/0x29adA1b5217242DEaBB142BC3b1bCfFdd56008e7#readContract salt 0 + SmartAccountAddress: &smartWalletAddress, + } +} + +func GetAggregatorConfig() *config.Config { + return &config.Config{ + SmartWallet: &config.SmartWalletConfig{ + EthRpcUrl: GetTestRPCURL(), + EthWsUrl: GetTestWsRPCURL(), + FactoryAddress: common.HexToAddress("0x29adA1b5217242DEaBB142BC3b1bCfFdd56008e7"), + EntrypointAddress: common.HexToAddress("0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"), + }, + } +} + func GetDefaultCache() *bigcache.BigCache { config := bigcache.Config{ @@ -122,3 +157,34 @@ func GetDefaultCache() *bigcache.BigCache { return cache } + +func RestTask() *avsproto.CreateTaskReq { + node := &avsproto.TaskNode{ + Id: "ping1", + Name: "ping", + TaskType: &avsproto.TaskNode_RestApi{ + &avsproto.RestAPINode{ + Url: "https://httpbin.org", + }, + }, + } + edge := &avsproto.TaskEdge{ + Id: "edge1", + Source: "__TRIGGER__", + Target: "ping1", + } + tr1 := avsproto.CreateTaskReq{ + Trigger: &avsproto.TaskTrigger{ + Name: "block", + TriggerType: &avsproto.TaskTrigger_Block{ + Block: &avsproto.BlockCondition{ + Interval: 5, + }, + }, + }, + MaxExecution: 1000, + Nodes: []*avsproto.TaskNode{node}, + Edges: []*avsproto.TaskEdge{edge}, + } + return &tr1 +} diff --git a/examples/decode-create-account.js b/examples/decode-create-account.js new file mode 100644 index 00000000..ffcf8930 --- /dev/null +++ b/examples/decode-create-account.js @@ -0,0 +1,15 @@ +import { Interface, getBytes } from "ethers"; + +// Define the ABI for the `createAccount` function +const abi = [ + "function createAccount(bytes[] owners, uint256 nonce) payable returns (address account)" +]; +const iface = new Interface(abi); + +// Define the call data +const calldata = "0x0ba5ed0c6aa8c49038f819e587e2633c4a9f428a3ffba36f00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000040af3f636f8d3e064aed26273c1a453c3abf51c18b54c84b27ce02991aa8d8293b4f5bfa48dda9a26ddf45cc538cb442eb584ab819c4d0684ce390d87e18e554fbe15b0a8c44ecad456533d0110ead2ce0"; + +// Decode the call data +const decodedData = iface.decodeFunctionData("createAccount", getBytes("0x" + calldata.substring(42))); + +console.log("Decoded Data:", decodedData); diff --git a/examples/encode-create-account.js b/examples/encode-create-account.js new file mode 100644 index 00000000..2743ed7b --- /dev/null +++ b/examples/encode-create-account.js @@ -0,0 +1,6 @@ +import { keccak256, toUtf8Bytes } from "ethers"; + +// Compute the selector manually +const functionSignature = "createAccount(bytes[],uint256)"; +const expectedSelector = keccak256(toUtf8Bytes(functionSignature)).slice(0, 10); +console.log("Expected Selector:", expectedSelector); diff --git a/examples/example.js b/examples/example.js index 0259d06a..fdf021b8 100644 --- a/examples/example.js +++ b/examples/example.js @@ -116,7 +116,7 @@ async function listTask(owner, token) { client, "ListTasks", { - smart_wallet_address: process.argv[3], + smart_wallet_address: process.argv[3].split(","), cursor: process.argv[4] || "", item_per_page: 2, }, @@ -140,11 +140,11 @@ async function getTask(owner, token, taskId) { console.log(util.inspect(result, { depth: 4, colors: true })); } -async function listExecutions(owner, token, taskId) { +async function listExecutions(owner, token, ids) { const metadata = new grpc.Metadata(); metadata.add("authkey", token); - const result = await asyncRPC(client, "ListExecutions", { id: taskId, cursor: process.argv[4] || "", item_per_page: 200 }, metadata); + const result = await asyncRPC(client, "ListExecutions", { task_ids: ids.split(","), cursor: process.argv[4] || "", item_per_page: 200 }, metadata); console.log(util.inspect(result, { depth: 4, colors: true })); } @@ -261,7 +261,7 @@ const createWallet = async (owner, token, salt, factoryAddress) => { return await asyncRPC( client, - "CreateWallet", + "GetWallet", { salt, factoryAddress }, metadata ); @@ -391,7 +391,7 @@ const main = async (cmd) => { create-wallet : to create a smart wallet with a salt, and optionally a factory contract wallet: to list smart wallet address that has been created. note that a default wallet with salt=0 will automatically created - tasks : to list all tasks of given smart wallet address + tasks ,,...: to list all tasks of given smart wallet address get : to get task detail. a permission error is throw if the eoa isn't the smart wallet owner. executions : to get task execution history. a permission error is throw if the eoa isn't the smart wallet owner. schedule : to schedule a task that run on every block, with chainlink eth-usd its condition will be matched quickly diff --git a/examples/static_codegen/avs_pb.js b/examples/static_codegen/avs_pb.js index 41c4bf27..d6aabe01 100644 --- a/examples/static_codegen/avs_pb.js +++ b/examples/static_codegen/avs_pb.js @@ -668,7 +668,7 @@ if (goog.DEBUG && !COMPILED) { * @constructor */ proto.aggregator.ListTasksReq = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); + jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.ListTasksReq.repeatedFields_, null); }; goog.inherits(proto.aggregator.ListTasksReq, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -731,7 +731,7 @@ if (goog.DEBUG && !COMPILED) { * @constructor */ proto.aggregator.ListExecutionsReq = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); + jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.ListExecutionsReq.repeatedFields_, null); }; goog.inherits(proto.aggregator.ListExecutionsReq, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -7628,6 +7628,13 @@ proto.aggregator.ListWalletResp.prototype.clearItemsList = function() { +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.aggregator.ListTasksReq.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -7659,7 +7666,7 @@ proto.aggregator.ListTasksReq.prototype.toObject = function(opt_includeInstance) */ proto.aggregator.ListTasksReq.toObject = function(includeInstance, msg) { var f, obj = { - smartWalletAddress: jspb.Message.getFieldWithDefault(msg, 1, ""), + smartWalletAddressList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, cursor: jspb.Message.getFieldWithDefault(msg, 2, ""), itemPerPage: jspb.Message.getFieldWithDefault(msg, 3, 0) }; @@ -7700,7 +7707,7 @@ proto.aggregator.ListTasksReq.deserializeBinaryFromReader = function(msg, reader switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setSmartWalletAddress(value); + msg.addSmartWalletAddress(value); break; case 2: var value = /** @type {string} */ (reader.readString()); @@ -7739,9 +7746,9 @@ proto.aggregator.ListTasksReq.prototype.serializeBinary = function() { */ proto.aggregator.ListTasksReq.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getSmartWalletAddress(); + f = message.getSmartWalletAddressList(); if (f.length > 0) { - writer.writeString( + writer.writeRepeatedString( 1, f ); @@ -7764,20 +7771,39 @@ proto.aggregator.ListTasksReq.serializeBinaryToWriter = function(message, writer /** - * optional string smart_wallet_address = 1; - * @return {string} + * repeated string smart_wallet_address = 1; + * @return {!Array} */ -proto.aggregator.ListTasksReq.prototype.getSmartWalletAddress = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.aggregator.ListTasksReq.prototype.getSmartWalletAddressList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.aggregator.ListTasksReq} returns this + */ +proto.aggregator.ListTasksReq.prototype.setSmartWalletAddressList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** * @param {string} value + * @param {number=} opt_index * @return {!proto.aggregator.ListTasksReq} returns this */ -proto.aggregator.ListTasksReq.prototype.setSmartWalletAddress = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.aggregator.ListTasksReq.prototype.addSmartWalletAddress = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.aggregator.ListTasksReq} returns this + */ +proto.aggregator.ListTasksReq.prototype.clearSmartWalletAddressList = function() { + return this.setSmartWalletAddressList([]); }; @@ -7858,7 +7884,8 @@ proto.aggregator.ListTasksResp.toObject = function(includeInstance, msg) { var f, obj = { itemsList: jspb.Message.toObjectList(msg.getItemsList(), proto.aggregator.ListTasksResp.Item.toObject, includeInstance), - cursor: jspb.Message.getFieldWithDefault(msg, 2, "") + cursor: jspb.Message.getFieldWithDefault(msg, 2, ""), + hasMore: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) }; if (includeInstance) { @@ -7904,6 +7931,10 @@ proto.aggregator.ListTasksResp.deserializeBinaryFromReader = function(msg, reade var value = /** @type {string} */ (reader.readString()); msg.setCursor(value); break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasMore(value); + break; default: reader.skipField(); break; @@ -7948,6 +7979,13 @@ proto.aggregator.ListTasksResp.serializeBinaryToWriter = function(message, write f ); } + f = message.getHasMore(); + if (f) { + writer.writeBool( + 3, + f + ); + } }; @@ -8488,6 +8526,31 @@ proto.aggregator.ListTasksResp.prototype.setCursor = function(value) { }; +/** + * optional bool has_more = 3; + * @return {boolean} + */ +proto.aggregator.ListTasksResp.prototype.getHasMore = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.aggregator.ListTasksResp} returns this + */ +proto.aggregator.ListTasksResp.prototype.setHasMore = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.aggregator.ListExecutionsReq.repeatedFields_ = [1]; @@ -8520,7 +8583,7 @@ proto.aggregator.ListExecutionsReq.prototype.toObject = function(opt_includeInst */ proto.aggregator.ListExecutionsReq.toObject = function(includeInstance, msg) { var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), + taskIdsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, cursor: jspb.Message.getFieldWithDefault(msg, 2, ""), itemPerPage: jspb.Message.getFieldWithDefault(msg, 3, 0) }; @@ -8561,7 +8624,7 @@ proto.aggregator.ListExecutionsReq.deserializeBinaryFromReader = function(msg, r switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setId(value); + msg.addTaskIds(value); break; case 2: var value = /** @type {string} */ (reader.readString()); @@ -8600,9 +8663,9 @@ proto.aggregator.ListExecutionsReq.prototype.serializeBinary = function() { */ proto.aggregator.ListExecutionsReq.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getId(); + f = message.getTaskIdsList(); if (f.length > 0) { - writer.writeString( + writer.writeRepeatedString( 1, f ); @@ -8625,20 +8688,39 @@ proto.aggregator.ListExecutionsReq.serializeBinaryToWriter = function(message, w /** - * optional string id = 1; - * @return {string} + * repeated string task_ids = 1; + * @return {!Array} */ -proto.aggregator.ListExecutionsReq.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.aggregator.ListExecutionsReq.prototype.getTaskIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.aggregator.ListExecutionsReq} returns this + */ +proto.aggregator.ListExecutionsReq.prototype.setTaskIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** * @param {string} value + * @param {number=} opt_index * @return {!proto.aggregator.ListExecutionsReq} returns this */ -proto.aggregator.ListExecutionsReq.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.aggregator.ListExecutionsReq.prototype.addTaskIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.aggregator.ListExecutionsReq} returns this + */ +proto.aggregator.ListExecutionsReq.prototype.clearTaskIdsList = function() { + return this.setTaskIdsList([]); }; @@ -8719,7 +8801,8 @@ proto.aggregator.ListExecutionsResp.toObject = function(includeInstance, msg) { var f, obj = { itemsList: jspb.Message.toObjectList(msg.getItemsList(), proto.aggregator.Execution.toObject, includeInstance), - cursor: jspb.Message.getFieldWithDefault(msg, 2, "") + cursor: jspb.Message.getFieldWithDefault(msg, 2, ""), + hasMore: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) }; if (includeInstance) { @@ -8765,6 +8848,10 @@ proto.aggregator.ListExecutionsResp.deserializeBinaryFromReader = function(msg, var value = /** @type {string} */ (reader.readString()); msg.setCursor(value); break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasMore(value); + break; default: reader.skipField(); break; @@ -8809,6 +8896,13 @@ proto.aggregator.ListExecutionsResp.serializeBinaryToWriter = function(message, f ); } + f = message.getHasMore(); + if (f) { + writer.writeBool( + 4, + f + ); + } }; @@ -8868,6 +8962,24 @@ proto.aggregator.ListExecutionsResp.prototype.setCursor = function(value) { }; +/** + * optional bool has_more = 4; + * @return {boolean} + */ +proto.aggregator.ListExecutionsResp.prototype.getHasMore = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.aggregator.ListExecutionsResp} returns this + */ +proto.aggregator.ListExecutionsResp.prototype.setHasMore = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + diff --git a/examples/util.js b/examples/util.js new file mode 100644 index 00000000..28bd54d1 --- /dev/null +++ b/examples/util.js @@ -0,0 +1,18 @@ +const { ethers } = require("ethers"); + +// Your contract ABI +const abi = [ + "function balanceOf(address account) external view returns (uint256)", + "function getRoundData(uint80 _roundId) view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)", + "function latestRoundData() public view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)", +]; + +// Function to encode +const iface = new ethers.Interface(abi); +const call1 = iface.encodeFunctionData("getRoundData", ["18446744073709572839"]); +console.log("Encoded Call1 Data:", call1); +const call2 = iface.encodeFunctionData("balanceOf", ["0xce289bb9fb0a9591317981223cbe33d5dc42268d"]); +console.log("Encoded Call2 Data:", call2); +const call3 = iface.encodeFunctionData("latestRoundData"); +console.log("Encoded Call3 Data:", call3); + diff --git a/protobuf/avs.pb.go b/protobuf/avs.pb.go index f420b180..f5babf7a 100644 --- a/protobuf/avs.pb.go +++ b/protobuf/avs.pb.go @@ -2233,9 +2233,9 @@ type ListTasksReq struct { unknownFields protoimpl.UnknownFields // Filter out by the smart_wallet_address - SmartWalletAddress string `protobuf:"bytes,1,opt,name=smart_wallet_address,json=smartWalletAddress,proto3" json:"smart_wallet_address,omitempty"` - Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` - ItemPerPage int64 `protobuf:"varint,3,opt,name=item_per_page,json=itemPerPage,proto3" json:"item_per_page,omitempty"` + SmartWalletAddress []string `protobuf:"bytes,1,rep,name=smart_wallet_address,json=smartWalletAddress,proto3" json:"smart_wallet_address,omitempty"` + Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` + ItemPerPage int64 `protobuf:"varint,3,opt,name=item_per_page,json=itemPerPage,proto3" json:"item_per_page,omitempty"` } func (x *ListTasksReq) Reset() { @@ -2270,11 +2270,11 @@ func (*ListTasksReq) Descriptor() ([]byte, []int) { return file_protobuf_avs_proto_rawDescGZIP(), []int{27} } -func (x *ListTasksReq) GetSmartWalletAddress() string { +func (x *ListTasksReq) GetSmartWalletAddress() []string { if x != nil { return x.SmartWalletAddress } - return "" + return nil } func (x *ListTasksReq) GetCursor() string { @@ -2296,8 +2296,9 @@ type ListTasksResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Items []*ListTasksResp_Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` + Items []*ListTasksResp_Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` + HasMore bool `protobuf:"varint,3,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"` } func (x *ListTasksResp) Reset() { @@ -2346,14 +2347,21 @@ func (x *ListTasksResp) GetCursor() string { return "" } +func (x *ListTasksResp) GetHasMore() bool { + if x != nil { + return x.HasMore + } + return false +} + type ListExecutionsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` - ItemPerPage int64 `protobuf:"varint,3,opt,name=item_per_page,json=itemPerPage,proto3" json:"item_per_page,omitempty"` + TaskIds []string `protobuf:"bytes,1,rep,name=task_ids,json=taskIds,proto3" json:"task_ids,omitempty"` + Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` + ItemPerPage int64 `protobuf:"varint,3,opt,name=item_per_page,json=itemPerPage,proto3" json:"item_per_page,omitempty"` } func (x *ListExecutionsReq) Reset() { @@ -2388,11 +2396,11 @@ func (*ListExecutionsReq) Descriptor() ([]byte, []int) { return file_protobuf_avs_proto_rawDescGZIP(), []int{29} } -func (x *ListExecutionsReq) GetId() string { +func (x *ListExecutionsReq) GetTaskIds() []string { if x != nil { - return x.Id + return x.TaskIds } - return "" + return nil } func (x *ListExecutionsReq) GetCursor() string { @@ -2414,8 +2422,9 @@ type ListExecutionsResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Items []*Execution `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` + Items []*Execution `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` + HasMore bool `protobuf:"varint,4,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"` } func (x *ListExecutionsResp) Reset() { @@ -2464,6 +2473,13 @@ func (x *ListExecutionsResp) GetCursor() string { return "" } +func (x *ListExecutionsResp) GetHasMore() bool { + if x != nil { + return x.HasMore + } + return false +} + type GetKeyReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3418,168 +3434,172 @@ var file_protobuf_avs_proto_rawDesc = []byte{ 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x7c, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x5f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0b, 0x69, 0x74, 0x65, 0x6d, 0x50, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0x80, 0x04, + 0x52, 0x0b, 0x69, 0x74, 0x65, 0x6d, 0x50, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0x9b, 0x04, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x1a, 0xa0, 0x03, - 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x14, - 0x73, 0x6d, 0x61, 0x72, 0x74, 0x5f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x6d, 0x61, 0x72, - 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, - 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, - 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x21, 0x0a, 0x0c, - 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, - 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, - 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x61, 0x6e, 0x41, 0x74, 0x12, 0x2e, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, - 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x19, 0x0a, + 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x1a, 0xa0, 0x03, 0x0a, 0x04, 0x49, 0x74, 0x65, + 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x6d, 0x61, 0x72, 0x74, + 0x5f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, + 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, + 0x78, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x27, 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x72, 0x61, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, + 0x61, 0x73, 0x74, 0x52, 0x61, 0x6e, 0x41, 0x74, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x22, 0x6a, 0x0a, 0x11, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, + 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, + 0x73, 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x65, 0x72, 0x5f, + 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x74, 0x65, 0x6d, + 0x50, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0x74, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, + 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, + 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, + 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x22, 0x5e, 0x0a, + 0x09, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x1b, 0x0a, + 0x07, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x80, 0x01, 0x0a, 0x0f, 0x54, + 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, + 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, + 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x4b, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, + 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, + 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x66, 0x0a, 0x0d, 0x47, 0x65, + 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, + 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, + 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, + 0x49, 0x64, 0x12, 0x46, 0x0a, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x74, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0a, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x67, 0x0a, 0x13, 0x55, + 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x15, 0x0a, + 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, + 0x6f, 0x62, 0x49, 0x64, 0x2a, 0xc8, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0f, + 0x0a, 0x0b, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x00, 0x12, + 0x11, 0x0a, 0x0c, 0x52, 0x70, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, + 0xe8, 0x07, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, 0x6e, 0x61, + 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xd0, 0x0f, 0x12, 0x16, 0x0a, 0x11, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x10, 0xd1, 0x0f, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, + 0x65, 0x74, 0x52, 0x70, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf0, 0x2e, 0x12, 0x1d, 0x0a, + 0x18, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x46, + 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf1, 0x2e, 0x12, 0x16, 0x0a, 0x11, + 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x72, 0x72, 0x75, 0x70, 0x74, 0x65, + 0x64, 0x10, 0xd8, 0x36, 0x12, 0x19, 0x0a, 0x14, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, + 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd9, 0x36, 0x2a, + 0x50, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, + 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, + 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x10, + 0x04, 0x2a, 0x20, 0x0a, 0x0e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x4c, + 0x61, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x0a, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x10, 0x00, 0x32, 0xef, 0x05, 0x0a, 0x0a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, + 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x47, 0x65, + 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, + 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, + 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x46, 0x0a, + 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, + 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x61, 0x73, 0x6b, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, + 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, + 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, + 0x12, 0x30, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, - 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, - 0x22, 0x5f, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x22, 0x0a, - 0x0d, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x74, 0x65, 0x6d, 0x50, 0x65, 0x72, 0x50, 0x61, 0x67, - 0x65, 0x22, 0x59, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0x5e, 0x0a, 0x09, - 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, - 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x1b, 0x0a, 0x07, - 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x80, 0x01, 0x0a, 0x0f, 0x54, 0x72, - 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, - 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x0a, - 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x4b, 0x0a, 0x0c, - 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, - 0x73, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, - 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, - 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x66, 0x0a, 0x0d, 0x47, 0x65, 0x74, - 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, 0x74, - 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, - 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, - 0x64, 0x12, 0x46, 0x0a, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, - 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x67, 0x0a, 0x13, 0x55, 0x73, - 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, - 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, - 0x62, 0x49, 0x64, 0x2a, 0xc8, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0f, 0x0a, - 0x0b, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x00, 0x12, 0x11, - 0x0a, 0x0c, 0x52, 0x70, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xe8, - 0x07, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, 0x6e, 0x61, 0x76, - 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xd0, 0x0f, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, - 0xd1, 0x0f, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, - 0x74, 0x52, 0x70, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf0, 0x2e, 0x12, 0x1d, 0x0a, 0x18, - 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x46, 0x6f, - 0x75, 0x6e, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf1, 0x2e, 0x12, 0x16, 0x0a, 0x11, 0x54, - 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x72, 0x72, 0x75, 0x70, 0x74, 0x65, 0x64, - 0x10, 0xd8, 0x36, 0x12, 0x19, 0x0a, 0x14, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x4d, - 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd9, 0x36, 0x2a, 0x50, - 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x65, 0x64, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, - 0x64, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, - 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x10, 0x04, - 0x2a, 0x20, 0x0a, 0x0e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x4c, 0x61, - 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x0a, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x10, 0x00, 0x32, 0xef, 0x05, 0x0a, 0x0a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x36, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x2e, 0x61, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, - 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x47, 0x65, 0x74, - 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x57, - 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, - 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, - 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0b, - 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x61, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, - 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, - 0x73, 0x6b, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x4c, - 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, - 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x30, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x22, - 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x61, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, + 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, - 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x49, - 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, - 0x6b, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, - 0x71, 0x1a, 0x1f, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x61, 0x76, 0x73, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, + 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x61, 0x76, 0x73, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protobuf/avs.proto b/protobuf/avs.proto index fa083773..d8e5927a 100644 --- a/protobuf/avs.proto +++ b/protobuf/avs.proto @@ -307,7 +307,7 @@ message ListWalletResp { message ListTasksReq { // Filter out by the smart_wallet_address - string smart_wallet_address = 1; + repeated string smart_wallet_address = 1; string cursor = 2; int64 item_per_page = 3; } @@ -339,10 +339,11 @@ message ListTasksResp { repeated Item items = 1; string cursor = 2; + bool has_more = 3; } message ListExecutionsReq { - string id = 1; + repeated string task_ids = 1; string cursor = 2; int64 item_per_page = 3; } @@ -350,6 +351,7 @@ message ListExecutionsReq { message ListExecutionsResp { repeated Execution items = 1; string cursor = 2; + bool has_more = 4; } message GetKeyReq { diff --git a/storage/db.go b/storage/db.go index 4a578749..bbbbcb70 100644 --- a/storage/db.go +++ b/storage/db.go @@ -31,6 +31,7 @@ type Storage interface { // A key only operation that returns key that has a prefix ListKeys(prefix string) ([]string, error) + ListKeysMulti(prefixes []string) ([]string, error) BatchWrite(updates map[string][]byte) error Move(src, dest []byte) error @@ -311,6 +312,25 @@ func (a *BadgerStorage) ListKeys(prefix string) ([]string, error) { return nil, err } +// ListKeys from multiple suffix. This is similar to a join in RDBMS +func (a *BadgerStorage) ListKeysMulti(prefixes []string) ([]string, error) { + var keys []string + + for _, prefix := range prefixes { + if len(prefix) == 0 { + continue + } + + data, err := a.ListKeys(prefix) + if err != nil { + continue + } + keys = append(keys, data...) + } + + return keys, nil +} + func (a *BadgerStorage) Vacuum() error { return a.db.RunValueLogGC(0.7) } From 275799a085877f633ec657821f69b0c2f346f778 Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 26 Dec 2024 15:07:42 -0800 Subject: [PATCH 03/19] Fix #78 to add type to trigger metadata --- core/taskengine/doc.go | 2 +- core/taskengine/engine.go | 25 +- core/taskengine/errors.go | 1 + core/taskengine/schema.go | 7 +- examples/example.js | 10 +- examples/static_codegen/avs_pb.js | 45 ++- protobuf/avs.pb.go | 508 +++++++++++++++++------------- protobuf/avs.proto | 18 ++ 8 files changed, 395 insertions(+), 221 deletions(-) diff --git a/core/taskengine/doc.go b/core/taskengine/doc.go index dec9d460..7f46c95a 100644 --- a/core/taskengine/doc.go +++ b/core/taskengine/doc.go @@ -10,7 +10,7 @@ w:: = {factory_address: address, salt: salt} w:: -> {factory, salt} t:: -> task payload, the source of truth of task information u::: -> task status -h::: -> an execution history +history:: -> an execution history The task storage was designed for fast retrieve time at the cost of extra storage. diff --git a/core/taskengine/engine.go b/core/taskengine/engine.go index cfb35f3c..125f735a 100644 --- a/core/taskengine/engine.go +++ b/core/taskengine/engine.go @@ -558,6 +558,7 @@ func (n *Engine) TriggerTask(user *model.User, payload *avsproto.UserTriggerTask if payload.IsBlocking { // Run the task inline, by pass the queue system executor := NewExecutor(n.db, n.logger) + fmt.Println("metadata", payload.TriggerMetadata) execution, err := executor.RunTask(task, payload.TriggerMetadata) if err == nil { return &avsproto.UserTriggerTaskResp{ @@ -585,7 +586,9 @@ func (n *Engine) TriggerTask(user *model.User, payload *avsproto.UserTriggerTask // List Execution for a given task id func (n *Engine) ListExecutions(user *model.User, payload *avsproto.ListExecutionsReq) (*avsproto.ListExecutionsResp, error) { - // Validate all tasks own by the caller + // Validate all tasks own by the caller, if there are any tasks won't be owned by caller, we return permission error + tasks := make(map[string]*model.Task) + for _, id := range payload.TaskIds { task, err := n.GetTaskByID(id) if err != nil { @@ -595,6 +598,7 @@ func (n *Engine) ListExecutions(user *model.User, payload *avsproto.ListExecutio if !task.OwnedBy(user.Address) { return nil, grpcstatus.Errorf(codes.NotFound, TaskNotFoundError) } + tasks[id] = task } prefixes := make([]string, len(payload.TaskIds)) @@ -639,6 +643,7 @@ func (n *Engine) ListExecutions(user *model.User, payload *avsproto.ListExecutio for i := len(executionKeys) - 1; i >= 0; i-- { key := executionKeys[i] visited = i + executionUlid := ulid.MustParse(ExecutionIdFromStorageKey([]byte(key))) if !cursor.IsZero() && cursor.LessThanOrEqualUlid(executionUlid) { continue @@ -651,6 +656,24 @@ func (n *Engine) ListExecutions(user *model.User, payload *avsproto.ListExecutio exec := avsproto.Execution{} if err := protojson.Unmarshal(executionValue, &exec); err == nil { + taskId := TaskIdFromExecutionStorageKey([]byte(key)) + task := tasks[taskId] + if task == nil { + // This cannot be happen, if it had corrupted storage + panic("program corrupted") + } + switch task.GetTrigger().GetTriggerType().(type) { + case *avsproto.TaskTrigger_Manual: + exec.TriggerMetadata.Type = avsproto.TriggerMetadata_Manual + case *avsproto.TaskTrigger_FixedTime: + exec.TriggerMetadata.Type = avsproto.TriggerMetadata_FixedTime + case *avsproto.TaskTrigger_Cron: + exec.TriggerMetadata.Type = avsproto.TriggerMetadata_Cron + case *avsproto.TaskTrigger_Block: + exec.TriggerMetadata.Type = avsproto.TriggerMetadata_Block + case *avsproto.TaskTrigger_Event: + exec.TriggerMetadata.Type = avsproto.TriggerMetadata_Event + } executioResp.Items = append(executioResp.Items, &exec) total += 1 } diff --git a/core/taskengine/errors.go b/core/taskengine/errors.go index f9aed325..efcc6e10 100644 --- a/core/taskengine/errors.go +++ b/core/taskengine/errors.go @@ -1,6 +1,7 @@ package taskengine const ( + InternalError = "internal error" TaskNotFoundError = "task not found" InvalidSmartAccountAddressError = "invalid smart account address" diff --git a/core/taskengine/schema.go b/core/taskengine/schema.go index 312b8555..7e0bae29 100644 --- a/core/taskengine/schema.go +++ b/core/taskengine/schema.go @@ -66,10 +66,15 @@ func TaskExecutionKey(t *model.Task, executionID string) []byte { } func ExecutionIdFromStorageKey(key []byte) string { - // key layout: history:01JEJWH9RCPY7S74XBW135S4GA:2 + // key layout: history:01JG2FE5MDVKBPHEG0PEYSDKAC:01JG2FE5MFKTH0754RGF2DMVY7 return string(key[35:]) } +func TaskIdFromExecutionStorageKey(key []byte) string { + // key layout: history:01JG2FE5MDVKBPHEG0PEYSDKAC:01JG2FE5MFKTH0754RGF2DMVY7 + return string(key[8:34]) +} + // Convert task status gRPC enum into the storage prefix // c: completed. task is completed and no longer being check for trigger anymore // f: failed. task is failed to executed, and no longer being check for trigger anymore diff --git a/examples/example.js b/examples/example.js index fdf021b8..df7f2397 100644 --- a/examples/example.js +++ b/examples/example.js @@ -178,20 +178,22 @@ async function deleteTask(owner, token, taskId) { console.log("Response:\n", result); } -async function triggerTask(owner, token, taskId, triggerMark) { +async function triggerTask(owner, token, taskId, triggerMetadata) { const metadata = new grpc.Metadata(); metadata.add("authkey", token); + console.log("triggermark", triggerMetadata) + const result = await asyncRPC( client, "TriggerTask", // If want to run async, comment this line out - //{ task_id: taskId, triggerMark, }, - { task_id: taskId, triggerMark, is_blocking: true }, + //{ task_id: taskId, triggerMetadata, }, + { task_id: taskId, trigger_metadata: JSON.parse(triggerMetadata), is_blocking: true }, metadata ); - console.log("request", { task_id: taskId, triggerMark }) + console.log("request", { task_id: taskId, triggerMetadata }) console.log("Response:\n", result); } diff --git a/examples/static_codegen/avs_pb.js b/examples/static_codegen/avs_pb.js index d6aabe01..edc633c4 100644 --- a/examples/static_codegen/avs_pb.js +++ b/examples/static_codegen/avs_pb.js @@ -67,6 +67,7 @@ goog.exportSymbol('proto.aggregator.TaskStatus', null, global); goog.exportSymbol('proto.aggregator.TaskTrigger', null, global); goog.exportSymbol('proto.aggregator.TaskTrigger.TriggerTypeCase', null, global); goog.exportSymbol('proto.aggregator.TriggerMetadata', null, global); +goog.exportSymbol('proto.aggregator.TriggerMetadata.TriggerType', null, global); goog.exportSymbol('proto.aggregator.UserTriggerTaskReq', null, global); goog.exportSymbol('proto.aggregator.UserTriggerTaskResp', null, global); /** @@ -9335,7 +9336,8 @@ proto.aggregator.TriggerMetadata.toObject = function(includeInstance, msg) { blockNumber: jspb.Message.getFieldWithDefault(msg, 1, 0), logIndex: jspb.Message.getFieldWithDefault(msg, 2, 0), txHash: jspb.Message.getFieldWithDefault(msg, 3, ""), - epoch: jspb.Message.getFieldWithDefault(msg, 4, 0) + epoch: jspb.Message.getFieldWithDefault(msg, 4, 0), + type: jspb.Message.getFieldWithDefault(msg, 5, 0) }; if (includeInstance) { @@ -9388,6 +9390,10 @@ proto.aggregator.TriggerMetadata.deserializeBinaryFromReader = function(msg, rea var value = /** @type {number} */ (reader.readUint64()); msg.setEpoch(value); break; + case 5: + var value = /** @type {!proto.aggregator.TriggerMetadata.TriggerType} */ (reader.readEnum()); + msg.setType(value); + break; default: reader.skipField(); break; @@ -9445,9 +9451,28 @@ proto.aggregator.TriggerMetadata.serializeBinaryToWriter = function(message, wri f ); } + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 5, + f + ); + } }; +/** + * @enum {number} + */ +proto.aggregator.TriggerMetadata.TriggerType = { + UNSET: 0, + MANUAL: 2, + FIXEDTIME: 3, + CRON: 4, + BLOCK: 5, + EVENT: 6 +}; + /** * optional uint64 block_number = 1; * @return {number} @@ -9520,6 +9545,24 @@ proto.aggregator.TriggerMetadata.prototype.setEpoch = function(value) { }; +/** + * optional TriggerType type = 5; + * @return {!proto.aggregator.TriggerMetadata.TriggerType} + */ +proto.aggregator.TriggerMetadata.prototype.getType = function() { + return /** @type {!proto.aggregator.TriggerMetadata.TriggerType} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {!proto.aggregator.TriggerMetadata.TriggerType} value + * @return {!proto.aggregator.TriggerMetadata} returns this + */ +proto.aggregator.TriggerMetadata.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 5, value); +}; + + diff --git a/protobuf/avs.pb.go b/protobuf/avs.pb.go index f5babf7a..5c0fccd9 100644 --- a/protobuf/avs.pb.go +++ b/protobuf/avs.pb.go @@ -192,6 +192,69 @@ func (CustomCodeLang) EnumDescriptor() ([]byte, []int) { return file_protobuf_avs_proto_rawDescGZIP(), []int{2} } +// This value isn't needed because when we query an execution or trigger a task, we know the trigger type +// But, The JS SDK needed this value probabaly to saving the lookup time when it only have execution id somehow +// So we added this value to the respose for the client to consume and use however it want +// Internaly we don't make use of this field. +// The client was map the field based on the one-off field number so we need to match this number with TaskTrigger.trigger_type +type TriggerMetadata_TriggerType int32 + +const ( + TriggerMetadata_Unset TriggerMetadata_TriggerType = 0 + TriggerMetadata_Manual TriggerMetadata_TriggerType = 2 + TriggerMetadata_FixedTime TriggerMetadata_TriggerType = 3 + TriggerMetadata_Cron TriggerMetadata_TriggerType = 4 + TriggerMetadata_Block TriggerMetadata_TriggerType = 5 + TriggerMetadata_Event TriggerMetadata_TriggerType = 6 +) + +// Enum value maps for TriggerMetadata_TriggerType. +var ( + TriggerMetadata_TriggerType_name = map[int32]string{ + 0: "Unset", + 2: "Manual", + 3: "FixedTime", + 4: "Cron", + 5: "Block", + 6: "Event", + } + TriggerMetadata_TriggerType_value = map[string]int32{ + "Unset": 0, + "Manual": 2, + "FixedTime": 3, + "Cron": 4, + "Block": 5, + "Event": 6, + } +) + +func (x TriggerMetadata_TriggerType) Enum() *TriggerMetadata_TriggerType { + p := new(TriggerMetadata_TriggerType) + *p = x + return p +} + +func (x TriggerMetadata_TriggerType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TriggerMetadata_TriggerType) Descriptor() protoreflect.EnumDescriptor { + return file_protobuf_avs_proto_enumTypes[3].Descriptor() +} + +func (TriggerMetadata_TriggerType) Type() protoreflect.EnumType { + return &file_protobuf_avs_proto_enumTypes[3] +} + +func (x TriggerMetadata_TriggerType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TriggerMetadata_TriggerType.Descriptor instead. +func (TriggerMetadata_TriggerType) EnumDescriptor() ([]byte, []int) { + return file_protobuf_avs_proto_rawDescGZIP(), []int{33, 0} +} + type IdReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2602,10 +2665,11 @@ type TriggerMetadata struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BlockNumber uint64 `protobuf:"varint,1,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - LogIndex uint64 `protobuf:"varint,2,opt,name=log_index,json=logIndex,proto3" json:"log_index,omitempty"` - TxHash string `protobuf:"bytes,3,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` - Epoch uint64 `protobuf:"varint,4,opt,name=epoch,proto3" json:"epoch,omitempty"` + BlockNumber uint64 `protobuf:"varint,1,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + LogIndex uint64 `protobuf:"varint,2,opt,name=log_index,json=logIndex,proto3" json:"log_index,omitempty"` + TxHash string `protobuf:"bytes,3,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` + Epoch uint64 `protobuf:"varint,4,opt,name=epoch,proto3" json:"epoch,omitempty"` + Type TriggerMetadata_TriggerType `protobuf:"varint,5,opt,name=type,proto3,enum=aggregator.TriggerMetadata_TriggerType" json:"type,omitempty"` } func (x *TriggerMetadata) Reset() { @@ -2668,6 +2732,13 @@ func (x *TriggerMetadata) GetEpoch() uint64 { return 0 } +func (x *TriggerMetadata) GetType() TriggerMetadata_TriggerType { + if x != nil { + return x.Type + } + return TriggerMetadata_Unset +} + type GetWalletReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3495,7 +3566,7 @@ var file_protobuf_avs_proto_rawDesc = []byte{ 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x1b, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x80, 0x01, 0x0a, 0x0f, 0x54, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x92, 0x02, 0x0a, 0x0f, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, @@ -3503,103 +3574,112 @@ var file_protobuf_avs_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x4b, 0x0a, - 0x0c, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, - 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, - 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x66, 0x0a, 0x0d, 0x47, 0x65, - 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, - 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, - 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, - 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, - 0x49, 0x64, 0x12, 0x46, 0x0a, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, - 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x74, 0x72, 0x69, 0x67, 0x67, - 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0a, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x67, 0x0a, 0x13, 0x55, - 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x15, 0x0a, - 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, - 0x6f, 0x62, 0x49, 0x64, 0x2a, 0xc8, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0f, - 0x0a, 0x0b, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x00, 0x12, - 0x11, 0x0a, 0x0c, 0x52, 0x70, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, - 0xe8, 0x07, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, 0x6e, 0x61, - 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xd0, 0x0f, 0x12, 0x16, 0x0a, 0x11, 0x53, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x10, 0xd1, 0x0f, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, - 0x65, 0x74, 0x52, 0x70, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf0, 0x2e, 0x12, 0x1d, 0x0a, - 0x18, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x46, - 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf1, 0x2e, 0x12, 0x16, 0x0a, 0x11, - 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x72, 0x72, 0x75, 0x70, 0x74, 0x65, - 0x64, 0x10, 0xd8, 0x36, 0x12, 0x19, 0x0a, 0x14, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, - 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd9, 0x36, 0x2a, - 0x50, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, - 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, - 0x65, 0x64, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, - 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x10, - 0x04, 0x2a, 0x20, 0x0a, 0x0e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x4c, - 0x61, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x0a, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x10, 0x00, 0x32, 0xef, 0x05, 0x0a, 0x0a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x2e, 0x61, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, - 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x47, 0x65, - 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, - 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, - 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, - 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x46, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x61, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, - 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x61, 0x73, 0x6b, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, - 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, - 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, - 0x12, 0x30, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x10, - 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, - 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, - 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, - 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, - 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, - 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x61, 0x76, 0x73, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3b, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x53, 0x0a, 0x0b, 0x54, 0x72, + 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x73, + 0x65, 0x74, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x10, 0x02, + 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x69, 0x78, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x10, 0x03, 0x12, + 0x08, 0x0a, 0x04, 0x43, 0x72, 0x6f, 0x6e, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x06, 0x22, + 0x4b, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, + 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, + 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x66, 0x0a, 0x0d, + 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, + 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x74, + 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, + 0x73, 0x6b, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x74, 0x72, 0x69, + 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, + 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x67, 0x0a, + 0x13, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x2a, 0xc8, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, + 0x00, 0x12, 0x11, 0x0a, 0x0c, 0x52, 0x70, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x10, 0xe8, 0x07, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, + 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xd0, 0x0f, 0x12, 0x16, 0x0a, + 0x11, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x10, 0xd1, 0x0f, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, + 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x70, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf0, 0x2e, 0x12, + 0x1d, 0x0a, 0x18, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4e, 0x6f, + 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf1, 0x2e, 0x12, 0x16, + 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x72, 0x72, 0x75, 0x70, + 0x74, 0x65, 0x64, 0x10, 0xd8, 0x36, 0x12, 0x19, 0x0a, 0x14, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, + 0x74, 0x61, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd9, + 0x36, 0x2a, 0x50, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x0a, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, + 0x69, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x65, 0x64, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, + 0x67, 0x10, 0x04, 0x2a, 0x20, 0x0a, 0x0e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, + 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x0a, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x10, 0x00, 0x32, 0xef, 0x05, 0x0a, 0x0a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, + 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, + 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, + 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, + 0x46, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x19, + 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, + 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, + 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, + 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x30, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, + 0x1a, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, + 0x73, 0x6b, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, + 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, + 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x61, 0x76, 0x73, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3614,122 +3694,124 @@ func file_protobuf_avs_proto_rawDescGZIP() []byte { return file_protobuf_avs_proto_rawDescData } -var file_protobuf_avs_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_protobuf_avs_proto_enumTypes = make([]protoimpl.EnumInfo, 4) var file_protobuf_avs_proto_msgTypes = make([]protoimpl.MessageInfo, 42) var file_protobuf_avs_proto_goTypes = []interface{}{ - (Error)(0), // 0: aggregator.Error - (TaskStatus)(0), // 1: aggregator.TaskStatus - (CustomCodeLang)(0), // 2: aggregator.CustomCodeLang - (*IdReq)(nil), // 3: aggregator.IdReq - (*FixedTimeCondition)(nil), // 4: aggregator.FixedTimeCondition - (*CronCondition)(nil), // 5: aggregator.CronCondition - (*BlockCondition)(nil), // 6: aggregator.BlockCondition - (*EventCondition)(nil), // 7: aggregator.EventCondition - (*TaskTrigger)(nil), // 8: aggregator.TaskTrigger - (*ETHTransferNode)(nil), // 9: aggregator.ETHTransferNode - (*ContractWriteNode)(nil), // 10: aggregator.ContractWriteNode - (*ContractReadNode)(nil), // 11: aggregator.ContractReadNode - (*GraphQLQueryNode)(nil), // 12: aggregator.GraphQLQueryNode - (*RestAPINode)(nil), // 13: aggregator.RestAPINode - (*CustomCodeNode)(nil), // 14: aggregator.CustomCodeNode - (*Condition)(nil), // 15: aggregator.Condition - (*BranchNode)(nil), // 16: aggregator.BranchNode - (*FilterNode)(nil), // 17: aggregator.FilterNode - (*LoopNode)(nil), // 18: aggregator.LoopNode - (*TaskEdge)(nil), // 19: aggregator.TaskEdge - (*TaskNode)(nil), // 20: aggregator.TaskNode - (*Execution)(nil), // 21: aggregator.Execution - (*Task)(nil), // 22: aggregator.Task - (*CreateTaskReq)(nil), // 23: aggregator.CreateTaskReq - (*CreateTaskResp)(nil), // 24: aggregator.CreateTaskResp - (*NonceRequest)(nil), // 25: aggregator.NonceRequest - (*NonceResp)(nil), // 26: aggregator.NonceResp - (*ListWalletReq)(nil), // 27: aggregator.ListWalletReq - (*SmartWallet)(nil), // 28: aggregator.SmartWallet - (*ListWalletResp)(nil), // 29: aggregator.ListWalletResp - (*ListTasksReq)(nil), // 30: aggregator.ListTasksReq - (*ListTasksResp)(nil), // 31: aggregator.ListTasksResp - (*ListExecutionsReq)(nil), // 32: aggregator.ListExecutionsReq - (*ListExecutionsResp)(nil), // 33: aggregator.ListExecutionsResp - (*GetKeyReq)(nil), // 34: aggregator.GetKeyReq - (*KeyResp)(nil), // 35: aggregator.KeyResp - (*TriggerMetadata)(nil), // 36: aggregator.TriggerMetadata - (*GetWalletReq)(nil), // 37: aggregator.GetWalletReq - (*GetWalletResp)(nil), // 38: aggregator.GetWalletResp - (*UserTriggerTaskReq)(nil), // 39: aggregator.UserTriggerTaskReq - (*UserTriggerTaskResp)(nil), // 40: aggregator.UserTriggerTaskResp - nil, // 41: aggregator.GraphQLQueryNode.VariablesEntry - nil, // 42: aggregator.RestAPINode.HeadersEntry - (*Execution_Step)(nil), // 43: aggregator.Execution.Step - (*ListTasksResp_Item)(nil), // 44: aggregator.ListTasksResp.Item - (*wrapperspb.BoolValue)(nil), // 45: google.protobuf.BoolValue + (Error)(0), // 0: aggregator.Error + (TaskStatus)(0), // 1: aggregator.TaskStatus + (CustomCodeLang)(0), // 2: aggregator.CustomCodeLang + (TriggerMetadata_TriggerType)(0), // 3: aggregator.TriggerMetadata.TriggerType + (*IdReq)(nil), // 4: aggregator.IdReq + (*FixedTimeCondition)(nil), // 5: aggregator.FixedTimeCondition + (*CronCondition)(nil), // 6: aggregator.CronCondition + (*BlockCondition)(nil), // 7: aggregator.BlockCondition + (*EventCondition)(nil), // 8: aggregator.EventCondition + (*TaskTrigger)(nil), // 9: aggregator.TaskTrigger + (*ETHTransferNode)(nil), // 10: aggregator.ETHTransferNode + (*ContractWriteNode)(nil), // 11: aggregator.ContractWriteNode + (*ContractReadNode)(nil), // 12: aggregator.ContractReadNode + (*GraphQLQueryNode)(nil), // 13: aggregator.GraphQLQueryNode + (*RestAPINode)(nil), // 14: aggregator.RestAPINode + (*CustomCodeNode)(nil), // 15: aggregator.CustomCodeNode + (*Condition)(nil), // 16: aggregator.Condition + (*BranchNode)(nil), // 17: aggregator.BranchNode + (*FilterNode)(nil), // 18: aggregator.FilterNode + (*LoopNode)(nil), // 19: aggregator.LoopNode + (*TaskEdge)(nil), // 20: aggregator.TaskEdge + (*TaskNode)(nil), // 21: aggregator.TaskNode + (*Execution)(nil), // 22: aggregator.Execution + (*Task)(nil), // 23: aggregator.Task + (*CreateTaskReq)(nil), // 24: aggregator.CreateTaskReq + (*CreateTaskResp)(nil), // 25: aggregator.CreateTaskResp + (*NonceRequest)(nil), // 26: aggregator.NonceRequest + (*NonceResp)(nil), // 27: aggregator.NonceResp + (*ListWalletReq)(nil), // 28: aggregator.ListWalletReq + (*SmartWallet)(nil), // 29: aggregator.SmartWallet + (*ListWalletResp)(nil), // 30: aggregator.ListWalletResp + (*ListTasksReq)(nil), // 31: aggregator.ListTasksReq + (*ListTasksResp)(nil), // 32: aggregator.ListTasksResp + (*ListExecutionsReq)(nil), // 33: aggregator.ListExecutionsReq + (*ListExecutionsResp)(nil), // 34: aggregator.ListExecutionsResp + (*GetKeyReq)(nil), // 35: aggregator.GetKeyReq + (*KeyResp)(nil), // 36: aggregator.KeyResp + (*TriggerMetadata)(nil), // 37: aggregator.TriggerMetadata + (*GetWalletReq)(nil), // 38: aggregator.GetWalletReq + (*GetWalletResp)(nil), // 39: aggregator.GetWalletResp + (*UserTriggerTaskReq)(nil), // 40: aggregator.UserTriggerTaskReq + (*UserTriggerTaskResp)(nil), // 41: aggregator.UserTriggerTaskResp + nil, // 42: aggregator.GraphQLQueryNode.VariablesEntry + nil, // 43: aggregator.RestAPINode.HeadersEntry + (*Execution_Step)(nil), // 44: aggregator.Execution.Step + (*ListTasksResp_Item)(nil), // 45: aggregator.ListTasksResp.Item + (*wrapperspb.BoolValue)(nil), // 46: google.protobuf.BoolValue } var file_protobuf_avs_proto_depIdxs = []int32{ - 4, // 0: aggregator.TaskTrigger.fixed_time:type_name -> aggregator.FixedTimeCondition - 5, // 1: aggregator.TaskTrigger.cron:type_name -> aggregator.CronCondition - 6, // 2: aggregator.TaskTrigger.block:type_name -> aggregator.BlockCondition - 7, // 3: aggregator.TaskTrigger.event:type_name -> aggregator.EventCondition - 41, // 4: aggregator.GraphQLQueryNode.variables:type_name -> aggregator.GraphQLQueryNode.VariablesEntry - 42, // 5: aggregator.RestAPINode.headers:type_name -> aggregator.RestAPINode.HeadersEntry + 5, // 0: aggregator.TaskTrigger.fixed_time:type_name -> aggregator.FixedTimeCondition + 6, // 1: aggregator.TaskTrigger.cron:type_name -> aggregator.CronCondition + 7, // 2: aggregator.TaskTrigger.block:type_name -> aggregator.BlockCondition + 8, // 3: aggregator.TaskTrigger.event:type_name -> aggregator.EventCondition + 42, // 4: aggregator.GraphQLQueryNode.variables:type_name -> aggregator.GraphQLQueryNode.VariablesEntry + 43, // 5: aggregator.RestAPINode.headers:type_name -> aggregator.RestAPINode.HeadersEntry 2, // 6: aggregator.CustomCodeNode.lang:type_name -> aggregator.CustomCodeLang - 15, // 7: aggregator.BranchNode.conditions:type_name -> aggregator.Condition - 9, // 8: aggregator.LoopNode.eth_transfer:type_name -> aggregator.ETHTransferNode - 10, // 9: aggregator.LoopNode.contract_write:type_name -> aggregator.ContractWriteNode - 11, // 10: aggregator.LoopNode.contract_read:type_name -> aggregator.ContractReadNode - 12, // 11: aggregator.LoopNode.graphql_data_query:type_name -> aggregator.GraphQLQueryNode - 13, // 12: aggregator.LoopNode.rest_api:type_name -> aggregator.RestAPINode - 14, // 13: aggregator.LoopNode.custom_code:type_name -> aggregator.CustomCodeNode - 9, // 14: aggregator.TaskNode.eth_transfer:type_name -> aggregator.ETHTransferNode - 10, // 15: aggregator.TaskNode.contract_write:type_name -> aggregator.ContractWriteNode - 11, // 16: aggregator.TaskNode.contract_read:type_name -> aggregator.ContractReadNode - 12, // 17: aggregator.TaskNode.graphql_query:type_name -> aggregator.GraphQLQueryNode - 13, // 18: aggregator.TaskNode.rest_api:type_name -> aggregator.RestAPINode - 16, // 19: aggregator.TaskNode.branch:type_name -> aggregator.BranchNode - 17, // 20: aggregator.TaskNode.filter:type_name -> aggregator.FilterNode - 18, // 21: aggregator.TaskNode.loop:type_name -> aggregator.LoopNode - 14, // 22: aggregator.TaskNode.custom_code:type_name -> aggregator.CustomCodeNode - 36, // 23: aggregator.Execution.trigger_metadata:type_name -> aggregator.TriggerMetadata - 43, // 24: aggregator.Execution.steps:type_name -> aggregator.Execution.Step + 16, // 7: aggregator.BranchNode.conditions:type_name -> aggregator.Condition + 10, // 8: aggregator.LoopNode.eth_transfer:type_name -> aggregator.ETHTransferNode + 11, // 9: aggregator.LoopNode.contract_write:type_name -> aggregator.ContractWriteNode + 12, // 10: aggregator.LoopNode.contract_read:type_name -> aggregator.ContractReadNode + 13, // 11: aggregator.LoopNode.graphql_data_query:type_name -> aggregator.GraphQLQueryNode + 14, // 12: aggregator.LoopNode.rest_api:type_name -> aggregator.RestAPINode + 15, // 13: aggregator.LoopNode.custom_code:type_name -> aggregator.CustomCodeNode + 10, // 14: aggregator.TaskNode.eth_transfer:type_name -> aggregator.ETHTransferNode + 11, // 15: aggregator.TaskNode.contract_write:type_name -> aggregator.ContractWriteNode + 12, // 16: aggregator.TaskNode.contract_read:type_name -> aggregator.ContractReadNode + 13, // 17: aggregator.TaskNode.graphql_query:type_name -> aggregator.GraphQLQueryNode + 14, // 18: aggregator.TaskNode.rest_api:type_name -> aggregator.RestAPINode + 17, // 19: aggregator.TaskNode.branch:type_name -> aggregator.BranchNode + 18, // 20: aggregator.TaskNode.filter:type_name -> aggregator.FilterNode + 19, // 21: aggregator.TaskNode.loop:type_name -> aggregator.LoopNode + 15, // 22: aggregator.TaskNode.custom_code:type_name -> aggregator.CustomCodeNode + 37, // 23: aggregator.Execution.trigger_metadata:type_name -> aggregator.TriggerMetadata + 44, // 24: aggregator.Execution.steps:type_name -> aggregator.Execution.Step 1, // 25: aggregator.Task.status:type_name -> aggregator.TaskStatus - 8, // 26: aggregator.Task.trigger:type_name -> aggregator.TaskTrigger - 20, // 27: aggregator.Task.nodes:type_name -> aggregator.TaskNode - 19, // 28: aggregator.Task.edges:type_name -> aggregator.TaskEdge - 8, // 29: aggregator.CreateTaskReq.trigger:type_name -> aggregator.TaskTrigger - 20, // 30: aggregator.CreateTaskReq.nodes:type_name -> aggregator.TaskNode - 19, // 31: aggregator.CreateTaskReq.edges:type_name -> aggregator.TaskEdge - 28, // 32: aggregator.ListWalletResp.items:type_name -> aggregator.SmartWallet - 44, // 33: aggregator.ListTasksResp.items:type_name -> aggregator.ListTasksResp.Item - 21, // 34: aggregator.ListExecutionsResp.items:type_name -> aggregator.Execution - 36, // 35: aggregator.UserTriggerTaskReq.trigger_metadata:type_name -> aggregator.TriggerMetadata - 1, // 36: aggregator.ListTasksResp.Item.status:type_name -> aggregator.TaskStatus - 8, // 37: aggregator.ListTasksResp.Item.trigger:type_name -> aggregator.TaskTrigger - 34, // 38: aggregator.Aggregator.GetKey:input_type -> aggregator.GetKeyReq - 25, // 39: aggregator.Aggregator.GetNonce:input_type -> aggregator.NonceRequest - 37, // 40: aggregator.Aggregator.GetWallet:input_type -> aggregator.GetWalletReq - 27, // 41: aggregator.Aggregator.ListWallets:input_type -> aggregator.ListWalletReq - 23, // 42: aggregator.Aggregator.CreateTask:input_type -> aggregator.CreateTaskReq - 30, // 43: aggregator.Aggregator.ListTasks:input_type -> aggregator.ListTasksReq - 3, // 44: aggregator.Aggregator.GetTask:input_type -> aggregator.IdReq - 32, // 45: aggregator.Aggregator.ListExecutions:input_type -> aggregator.ListExecutionsReq - 3, // 46: aggregator.Aggregator.CancelTask:input_type -> aggregator.IdReq - 3, // 47: aggregator.Aggregator.DeleteTask:input_type -> aggregator.IdReq - 39, // 48: aggregator.Aggregator.TriggerTask:input_type -> aggregator.UserTriggerTaskReq - 35, // 49: aggregator.Aggregator.GetKey:output_type -> aggregator.KeyResp - 26, // 50: aggregator.Aggregator.GetNonce:output_type -> aggregator.NonceResp - 38, // 51: aggregator.Aggregator.GetWallet:output_type -> aggregator.GetWalletResp - 29, // 52: aggregator.Aggregator.ListWallets:output_type -> aggregator.ListWalletResp - 24, // 53: aggregator.Aggregator.CreateTask:output_type -> aggregator.CreateTaskResp - 31, // 54: aggregator.Aggregator.ListTasks:output_type -> aggregator.ListTasksResp - 22, // 55: aggregator.Aggregator.GetTask:output_type -> aggregator.Task - 33, // 56: aggregator.Aggregator.ListExecutions:output_type -> aggregator.ListExecutionsResp - 45, // 57: aggregator.Aggregator.CancelTask:output_type -> google.protobuf.BoolValue - 45, // 58: aggregator.Aggregator.DeleteTask:output_type -> google.protobuf.BoolValue - 40, // 59: aggregator.Aggregator.TriggerTask:output_type -> aggregator.UserTriggerTaskResp - 49, // [49:60] is the sub-list for method output_type - 38, // [38:49] is the sub-list for method input_type - 38, // [38:38] is the sub-list for extension type_name - 38, // [38:38] is the sub-list for extension extendee - 0, // [0:38] is the sub-list for field type_name + 9, // 26: aggregator.Task.trigger:type_name -> aggregator.TaskTrigger + 21, // 27: aggregator.Task.nodes:type_name -> aggregator.TaskNode + 20, // 28: aggregator.Task.edges:type_name -> aggregator.TaskEdge + 9, // 29: aggregator.CreateTaskReq.trigger:type_name -> aggregator.TaskTrigger + 21, // 30: aggregator.CreateTaskReq.nodes:type_name -> aggregator.TaskNode + 20, // 31: aggregator.CreateTaskReq.edges:type_name -> aggregator.TaskEdge + 29, // 32: aggregator.ListWalletResp.items:type_name -> aggregator.SmartWallet + 45, // 33: aggregator.ListTasksResp.items:type_name -> aggregator.ListTasksResp.Item + 22, // 34: aggregator.ListExecutionsResp.items:type_name -> aggregator.Execution + 3, // 35: aggregator.TriggerMetadata.type:type_name -> aggregator.TriggerMetadata.TriggerType + 37, // 36: aggregator.UserTriggerTaskReq.trigger_metadata:type_name -> aggregator.TriggerMetadata + 1, // 37: aggregator.ListTasksResp.Item.status:type_name -> aggregator.TaskStatus + 9, // 38: aggregator.ListTasksResp.Item.trigger:type_name -> aggregator.TaskTrigger + 35, // 39: aggregator.Aggregator.GetKey:input_type -> aggregator.GetKeyReq + 26, // 40: aggregator.Aggregator.GetNonce:input_type -> aggregator.NonceRequest + 38, // 41: aggregator.Aggregator.GetWallet:input_type -> aggregator.GetWalletReq + 28, // 42: aggregator.Aggregator.ListWallets:input_type -> aggregator.ListWalletReq + 24, // 43: aggregator.Aggregator.CreateTask:input_type -> aggregator.CreateTaskReq + 31, // 44: aggregator.Aggregator.ListTasks:input_type -> aggregator.ListTasksReq + 4, // 45: aggregator.Aggregator.GetTask:input_type -> aggregator.IdReq + 33, // 46: aggregator.Aggregator.ListExecutions:input_type -> aggregator.ListExecutionsReq + 4, // 47: aggregator.Aggregator.CancelTask:input_type -> aggregator.IdReq + 4, // 48: aggregator.Aggregator.DeleteTask:input_type -> aggregator.IdReq + 40, // 49: aggregator.Aggregator.TriggerTask:input_type -> aggregator.UserTriggerTaskReq + 36, // 50: aggregator.Aggregator.GetKey:output_type -> aggregator.KeyResp + 27, // 51: aggregator.Aggregator.GetNonce:output_type -> aggregator.NonceResp + 39, // 52: aggregator.Aggregator.GetWallet:output_type -> aggregator.GetWalletResp + 30, // 53: aggregator.Aggregator.ListWallets:output_type -> aggregator.ListWalletResp + 25, // 54: aggregator.Aggregator.CreateTask:output_type -> aggregator.CreateTaskResp + 32, // 55: aggregator.Aggregator.ListTasks:output_type -> aggregator.ListTasksResp + 23, // 56: aggregator.Aggregator.GetTask:output_type -> aggregator.Task + 34, // 57: aggregator.Aggregator.ListExecutions:output_type -> aggregator.ListExecutionsResp + 46, // 58: aggregator.Aggregator.CancelTask:output_type -> google.protobuf.BoolValue + 46, // 59: aggregator.Aggregator.DeleteTask:output_type -> google.protobuf.BoolValue + 41, // 60: aggregator.Aggregator.TriggerTask:output_type -> aggregator.UserTriggerTaskResp + 50, // [50:61] is the sub-list for method output_type + 39, // [39:50] is the sub-list for method input_type + 39, // [39:39] is the sub-list for extension type_name + 39, // [39:39] is the sub-list for extension extendee + 0, // [0:39] is the sub-list for field type_name } func init() { file_protobuf_avs_proto_init() } @@ -4250,7 +4332,7 @@ func file_protobuf_avs_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protobuf_avs_proto_rawDesc, - NumEnums: 3, + NumEnums: 4, NumMessages: 42, NumExtensions: 0, NumServices: 1, diff --git a/protobuf/avs.proto b/protobuf/avs.proto index d8e5927a..dbda056a 100644 --- a/protobuf/avs.proto +++ b/protobuf/avs.proto @@ -35,6 +35,7 @@ message EventCondition { string expression = 1; } + message TaskTrigger { string name = 1; oneof trigger_type { @@ -377,6 +378,21 @@ message TriggerMetadata { uint64 log_index = 2; string tx_hash = 3; uint64 epoch = 4; + + // This value isn't needed because when we query an execution or trigger a task, we know the trigger type + // But, The JS SDK needed this value probabaly to saving the lookup time when it only have execution id somehow + // So we added this value to the respose for the client to consume and use however it want + // Internaly we don't make use of this field. + // The client was map the field based on the one-off field number so we need to match this number with TaskTrigger.trigger_type + enum TriggerType { + Unset = 0; + Manual = 2; + FixedTime = 3; + Cron = 4; + Block = 5; + Event = 6; + } + TriggerType type = 5; } message GetWalletReq { @@ -422,6 +438,8 @@ service Aggregator { rpc ListTasks(ListTasksReq) returns (ListTasksResp) {}; rpc GetTask(IdReq) returns (Task) {}; rpc ListExecutions(ListExecutionsReq) returns (ListExecutionsResp) {}; + //rpc GetExecution(GetExecutionReq) returns (E) {}; + rpc CancelTask(IdReq) returns (google.protobuf.BoolValue) {}; rpc DeleteTask(IdReq) returns (google.protobuf.BoolValue) {}; rpc TriggerTask(UserTriggerTaskReq) returns (UserTriggerTaskResp) {}; From 11a11e01d1c5ce43c8332b95252a2afbc433ea22 Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 26 Dec 2024 16:16:18 -0800 Subject: [PATCH 04/19] implement GetExecution --- aggregator/rpc_server.go | 14 + core/taskengine/engine.go | 35 +- core/taskengine/engine_test.go | 48 ++- core/taskengine/errors.go | 5 +- core/testutil/utils.go | 11 + examples/example.js | 44 ++- examples/static_codegen/avs_grpc_pb.js | 33 ++ examples/static_codegen/avs_pb.js | 214 +++++++++-- protobuf/avs.pb.go | 473 ++++++++++++++----------- protobuf/avs.proto | 9 +- protobuf/avs_grpc.pb.go | 36 ++ 11 files changed, 666 insertions(+), 256 deletions(-) diff --git a/aggregator/rpc_server.go b/aggregator/rpc_server.go index e00ddf02..4e95738e 100644 --- a/aggregator/rpc_server.go +++ b/aggregator/rpc_server.go @@ -176,6 +176,20 @@ func (r *RpcServer) ListExecutions(ctx context.Context, payload *avsproto.ListEx return r.engine.ListExecutions(user, payload) } +func (r *RpcServer) GetExecution(ctx context.Context, payload *avsproto.GetExecutionReq) (*avsproto.Execution, error) { + user, err := r.verifyAuth(ctx) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, "%s: %s", auth.AuthenticationError, err.Error()) + } + + r.config.Logger.Info("process get execution", + "user", user.Address.String(), + "task_id", payload.TaskId, + "execution_id", payload.ExecutionId, + ) + return r.engine.GetExecution(user, payload) +} + func (r *RpcServer) GetTask(ctx context.Context, payload *avsproto.IdReq) (*avsproto.Task, error) { user, err := r.verifyAuth(ctx) if err != nil { diff --git a/core/taskengine/engine.go b/core/taskengine/engine.go index 125f735a..14197f2f 100644 --- a/core/taskengine/engine.go +++ b/core/taskengine/engine.go @@ -580,7 +580,6 @@ func (n *Engine) TriggerTask(user *model.User, payload *avsproto.UserTriggerTask n.logger.Info("enqueue task into the queue system", "task_id", payload.TaskId, "jid", jid) return &avsproto.UserTriggerTaskResp{ Result: true, - JobId: fmt.Sprintf("%d", jid), }, nil } @@ -689,6 +688,40 @@ func (n *Engine) ListExecutions(user *model.User, payload *avsproto.ListExecutio return executioResp, nil } +// Get xecution for a given task id and execution id +func (n *Engine) GetExecution(user *model.User, payload *avsproto.GetExecutionReq) (*avsproto.Execution, error) { + // Validate all tasks own by the caller, if there are any tasks won't be owned by caller, we return permission error + task, err := n.GetTaskByID(payload.TaskId) + if err != nil { + return nil, grpcstatus.Errorf(codes.NotFound, TaskNotFoundError) + } + + if !task.OwnedBy(user.Address) { + return nil, grpcstatus.Errorf(codes.NotFound, TaskNotFoundError) + } + + executionValue, err := n.db.GetKey(TaskExecutionKey(task, payload.ExecutionId)) + if err != nil { + return nil, grpcstatus.Errorf(codes.NotFound, ExecutionNotFoundError) + } + exec := avsproto.Execution{} + if err := protojson.Unmarshal(executionValue, &exec); err == nil { + switch task.GetTrigger().GetTriggerType().(type) { + case *avsproto.TaskTrigger_Manual: + exec.TriggerMetadata.Type = avsproto.TriggerMetadata_Manual + case *avsproto.TaskTrigger_FixedTime: + exec.TriggerMetadata.Type = avsproto.TriggerMetadata_FixedTime + case *avsproto.TaskTrigger_Cron: + exec.TriggerMetadata.Type = avsproto.TriggerMetadata_Cron + case *avsproto.TaskTrigger_Block: + exec.TriggerMetadata.Type = avsproto.TriggerMetadata_Block + case *avsproto.TaskTrigger_Event: + exec.TriggerMetadata.Type = avsproto.TriggerMetadata_Event + } + } + return &exec, nil +} + func (n *Engine) DeleteTaskByUser(user *model.User, taskID string) (bool, error) { task, err := n.GetTask(user, taskID) diff --git a/core/taskengine/engine_test.go b/core/taskengine/engine_test.go index 4c576a7b..19330b96 100644 --- a/core/taskengine/engine_test.go +++ b/core/taskengine/engine_test.go @@ -12,7 +12,6 @@ import ( func TestListTasks(t *testing.T) { db := testutil.TestMustDB() defer storage.Destroy(db.(*storage.BadgerStorage)) - //defer db.Close() config := testutil.GetAggregatorConfig() n := New(db, config, nil, testutil.GetLogger()) @@ -75,7 +74,6 @@ func TestListTasks(t *testing.T) { func TestListTasksPagination(t *testing.T) { db := testutil.TestMustDB() defer storage.Destroy(db.(*storage.BadgerStorage)) - //defer db.Close() config := testutil.GetAggregatorConfig() n := New(db, config, nil, testutil.GetLogger()) @@ -185,3 +183,49 @@ func TestListTasksPagination(t *testing.T) { } } + +func TestGetExecution(t *testing.T) { + db := testutil.TestMustDB() + defer storage.Destroy(db.(*storage.BadgerStorage)) + + config := testutil.GetAggregatorConfig() + n := New(db, config, nil, testutil.GetLogger()) + + // Now create a test task + tr1 := testutil.RestTask() + tr1.Memo = "t1" + // salt 0 + tr1.SmartWalletAddress = "0x7c3a76086588230c7B3f4839A4c1F5BBafcd57C6" + result, _ := n.CreateTask(testutil.TestUser1(), tr1) + + resultTrigger, err := n.TriggerTask(testutil.TestUser1(), &avsproto.UserTriggerTaskReq{ + TaskId: result.Id, + TriggerMetadata: &avsproto.TriggerMetadata{ + BlockNumber: 101, + }, + IsBlocking: true, + }) + + // Now get back that exectuon id + execution, err := n.GetExecution(testutil.TestUser1(), &avsproto.GetExecutionReq{ + TaskId: result.Id, + ExecutionId: resultTrigger.ExecutionId, + }) + + if execution.Id != resultTrigger.ExecutionId { + t.Errorf("invalid execution id. expect %s got %s", resultTrigger.ExecutionId, execution.Id) + } + + if execution.TriggerMetadata.BlockNumber != 101 { + t.Errorf("invalid triggered block. expect 101 got %d", execution.TriggerMetadata.BlockNumber) + } + + // Another user cannot get this executin id + execution, err = n.GetExecution(testutil.TestUser2(), &avsproto.GetExecutionReq{ + TaskId: result.Id, + ExecutionId: resultTrigger.ExecutionId, + }) + if err == nil || execution != nil { + t.Errorf("expected failure getting other user execution but succesfully read it") + } +} diff --git a/core/taskengine/errors.go b/core/taskengine/errors.go index efcc6e10..aff20bda 100644 --- a/core/taskengine/errors.go +++ b/core/taskengine/errors.go @@ -1,8 +1,9 @@ package taskengine const ( - InternalError = "internal error" - TaskNotFoundError = "task not found" + InternalError = "internal error" + TaskNotFoundError = "task not found" + ExecutionNotFoundError = "execution not found" InvalidSmartAccountAddressError = "invalid smart account address" InvalidFactoryAddressError = "invalid factory address" diff --git a/core/testutil/utils.go b/core/testutil/utils.go index bd177625..e9302074 100644 --- a/core/testutil/utils.go +++ b/core/testutil/utils.go @@ -100,6 +100,17 @@ func TestUser1() *model.User { } } +func TestUser2() *model.User { + address := common.HexToAddress("0xd8da6bf26964af9d7eed9e03e53415d37aa96045") + smartWalletAddress := common.HexToAddress("0xBdCcA49575918De45bb32f5ba75388e7c3fBB5e4") + + return &model.User{ + Address: address, + // Factory https://sepolia.etherscan.io/address/0x29adA1b5217242DEaBB142BC3b1bCfFdd56008e7#readContract salt 0 + SmartAccountAddress: &smartWalletAddress, + } +} + func GetAggregatorConfig() *config.Config { return &config.Config{ SmartWallet: &config.SmartWalletConfig{ diff --git a/examples/example.js b/examples/example.js index df7f2397..ef12153f 100644 --- a/examples/example.js +++ b/examples/example.js @@ -149,6 +149,15 @@ async function listExecutions(owner, token, ids) { console.log(util.inspect(result, { depth: 4, colors: true })); } +async function getExecution(owner, token, task, execId) { + const metadata = new grpc.Metadata(); + metadata.add("authkey", token); + + const result = await asyncRPC(client, "GetExecution", { task_id: task, execution_id: execId }, metadata); + + console.log(util.inspect(result, { depth: 4, colors: true })); +} + async function cancel(owner, token, taskId) { const metadata = new grpc.Metadata(); @@ -366,6 +375,9 @@ const main = async (cmd) => { case "executions": await listExecutions(owner, token, process.argv[3]); break; + case "execution": + await getExecution(owner, token, process.argv[3], process.argv[4]); + break; case "cancel": await cancel(owner, token, process.argv[3]); break; @@ -391,21 +403,23 @@ const main = async (cmd) => { default: console.log(`Usage: - create-wallet : to create a smart wallet with a salt, and optionally a factory contract - wallet: to list smart wallet address that has been created. note that a default wallet with salt=0 will automatically created - tasks ,,...: to list all tasks of given smart wallet address - get : to get task detail. a permission error is throw if the eoa isn't the smart wallet owner. - executions : to get task execution history. a permission error is throw if the eoa isn't the smart wallet owner. - schedule : to schedule a task that run on every block, with chainlink eth-usd its condition will be matched quickly - schedule-cron : to schedule a task that run on cron - schedule-event : to schedule a task that run on occurenct of an event - schedule-generic: to schedule a task with an arbitrary contract query - monitor-address : to monitor erc20 in/out for an address - trigger : manually trigger a task. Example: - trigger abcdef '{"block_number":1234}' for blog trigger - trigger abcdef '{"block_number":1234, "log_index":312,"tx_hash":"0x123"}' for event trigger - cancel : to cancel a task - delete : to completely remove a task`); + create-wallet : to create a smart wallet with a salt, and optionally a factory contract + wallet: to list smart wallet address that has been created. note that a default wallet with salt=0 will automatically created + tasks ,,...: to list all tasks of given smart wallet address + get : to get task detail. a permission error is throw if the eoa isn't the smart wallet owner. + executions : to get task execution history. a permission error is throw if the eoa isn't the smart wallet owner. + execution : to get a single task execution history. a permission error is throw if the eoa isn't the smart wallet owner. + schedule : to schedule a task that run on every block, with chainlink eth-usd its condition will be matched quickly + schedule-cron : to schedule a task that run on cron + schedule-event : to schedule a task that run on occurenct of an event + schedule-generic: to schedule a task with an arbitrary contract query + monitor-address : to monitor erc20 in/out for an address + trigger : manually trigger a task. Example: + trigger abcdef '{"block_number":1234}' for blog trigger + trigger abcdef '{"block_number":1234, "log_index":312,"tx_hash":"0x123"}' for event trigger + trigger abcdef '{"epoch":1234, "log_index":312,"tx_hash":"0x123"}' for time based trigger (fixed or cron) + cancel : to cancel a task + delete : to completely remove a task`); } }; diff --git a/examples/static_codegen/avs_grpc_pb.js b/examples/static_codegen/avs_grpc_pb.js index 30f130c6..d1eda9d9 100644 --- a/examples/static_codegen/avs_grpc_pb.js +++ b/examples/static_codegen/avs_grpc_pb.js @@ -27,6 +27,28 @@ function deserialize_aggregator_CreateTaskResp(buffer_arg) { return avs_pb.CreateTaskResp.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_aggregator_Execution(arg) { + if (!(arg instanceof avs_pb.Execution)) { + throw new Error('Expected argument of type aggregator.Execution'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_aggregator_Execution(buffer_arg) { + return avs_pb.Execution.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_aggregator_GetExecutionReq(arg) { + if (!(arg instanceof avs_pb.GetExecutionReq)) { + throw new Error('Expected argument of type aggregator.GetExecutionReq'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_aggregator_GetExecutionReq(buffer_arg) { + return avs_pb.GetExecutionReq.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_aggregator_GetKeyReq(arg) { if (!(arg instanceof avs_pb.GetKeyReq)) { throw new Error('Expected argument of type aggregator.GetKeyReq'); @@ -307,6 +329,17 @@ createTask: { responseSerialize: serialize_aggregator_ListExecutionsResp, responseDeserialize: deserialize_aggregator_ListExecutionsResp, }, + getExecution: { + path: '/aggregator.Aggregator/GetExecution', + requestStream: false, + responseStream: false, + requestType: avs_pb.GetExecutionReq, + responseType: avs_pb.Execution, + requestSerialize: serialize_aggregator_GetExecutionReq, + requestDeserialize: deserialize_aggregator_GetExecutionReq, + responseSerialize: serialize_aggregator_Execution, + responseDeserialize: deserialize_aggregator_Execution, + }, cancelTask: { path: '/aggregator.Aggregator/CancelTask', requestStream: false, diff --git a/examples/static_codegen/avs_pb.js b/examples/static_codegen/avs_pb.js index edc633c4..a24668a7 100644 --- a/examples/static_codegen/avs_pb.js +++ b/examples/static_codegen/avs_pb.js @@ -40,6 +40,7 @@ goog.exportSymbol('proto.aggregator.Execution', null, global); goog.exportSymbol('proto.aggregator.Execution.Step', null, global); goog.exportSymbol('proto.aggregator.FilterNode', null, global); goog.exportSymbol('proto.aggregator.FixedTimeCondition', null, global); +goog.exportSymbol('proto.aggregator.GetExecutionReq', null, global); goog.exportSymbol('proto.aggregator.GetKeyReq', null, global); goog.exportSymbol('proto.aggregator.GetWalletReq', null, global); goog.exportSymbol('proto.aggregator.GetWalletResp', null, global); @@ -763,6 +764,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.aggregator.ListExecutionsResp.displayName = 'proto.aggregator.ListExecutionsResp'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.aggregator.GetExecutionReq = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.aggregator.GetExecutionReq, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.aggregator.GetExecutionReq.displayName = 'proto.aggregator.GetExecutionReq'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -8984,6 +9006,166 @@ proto.aggregator.ListExecutionsResp.prototype.setHasMore = function(value) { +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.aggregator.GetExecutionReq.prototype.toObject = function(opt_includeInstance) { + return proto.aggregator.GetExecutionReq.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.aggregator.GetExecutionReq} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.aggregator.GetExecutionReq.toObject = function(includeInstance, msg) { + var f, obj = { + taskId: jspb.Message.getFieldWithDefault(msg, 1, ""), + executionId: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.aggregator.GetExecutionReq} + */ +proto.aggregator.GetExecutionReq.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.aggregator.GetExecutionReq; + return proto.aggregator.GetExecutionReq.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.aggregator.GetExecutionReq} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.aggregator.GetExecutionReq} + */ +proto.aggregator.GetExecutionReq.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setTaskId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setExecutionId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.aggregator.GetExecutionReq.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.aggregator.GetExecutionReq.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.aggregator.GetExecutionReq} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.aggregator.GetExecutionReq.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTaskId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getExecutionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string task_id = 1; + * @return {string} + */ +proto.aggregator.GetExecutionReq.prototype.getTaskId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.aggregator.GetExecutionReq} returns this + */ +proto.aggregator.GetExecutionReq.prototype.setTaskId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string execution_id = 2; + * @return {string} + */ +proto.aggregator.GetExecutionReq.prototype.getExecutionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.aggregator.GetExecutionReq} returns this + */ +proto.aggregator.GetExecutionReq.prototype.setExecutionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -10157,8 +10339,7 @@ proto.aggregator.UserTriggerTaskResp.prototype.toObject = function(opt_includeIn proto.aggregator.UserTriggerTaskResp.toObject = function(includeInstance, msg) { var f, obj = { result: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), - executionId: jspb.Message.getFieldWithDefault(msg, 2, ""), - jobId: jspb.Message.getFieldWithDefault(msg, 3, "") + executionId: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { @@ -10203,10 +10384,6 @@ proto.aggregator.UserTriggerTaskResp.deserializeBinaryFromReader = function(msg, var value = /** @type {string} */ (reader.readString()); msg.setExecutionId(value); break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setJobId(value); - break; default: reader.skipField(); break; @@ -10250,13 +10427,6 @@ proto.aggregator.UserTriggerTaskResp.serializeBinaryToWriter = function(message, f ); } - f = message.getJobId(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } }; @@ -10296,24 +10466,6 @@ proto.aggregator.UserTriggerTaskResp.prototype.setExecutionId = function(value) }; -/** - * optional string job_id = 3; - * @return {string} - */ -proto.aggregator.UserTriggerTaskResp.prototype.getJobId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.aggregator.UserTriggerTaskResp} returns this - */ -proto.aggregator.UserTriggerTaskResp.prototype.setJobId = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - /** * @enum {number} */ diff --git a/protobuf/avs.pb.go b/protobuf/avs.pb.go index 5c0fccd9..719d69cc 100644 --- a/protobuf/avs.pb.go +++ b/protobuf/avs.pb.go @@ -252,7 +252,7 @@ func (x TriggerMetadata_TriggerType) Number() protoreflect.EnumNumber { // Deprecated: Use TriggerMetadata_TriggerType.Descriptor instead. func (TriggerMetadata_TriggerType) EnumDescriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{33, 0} + return file_protobuf_avs_proto_rawDescGZIP(), []int{34, 0} } type IdReq struct { @@ -2543,6 +2543,61 @@ func (x *ListExecutionsResp) GetHasMore() bool { return false } +type GetExecutionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + ExecutionId string `protobuf:"bytes,2,opt,name=execution_id,json=executionId,proto3" json:"execution_id,omitempty"` +} + +func (x *GetExecutionReq) Reset() { + *x = GetExecutionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_avs_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetExecutionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetExecutionReq) ProtoMessage() {} + +func (x *GetExecutionReq) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_avs_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetExecutionReq.ProtoReflect.Descriptor instead. +func (*GetExecutionReq) Descriptor() ([]byte, []int) { + return file_protobuf_avs_proto_rawDescGZIP(), []int{31} +} + +func (x *GetExecutionReq) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *GetExecutionReq) GetExecutionId() string { + if x != nil { + return x.ExecutionId + } + return "" +} + type GetKeyReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2556,7 +2611,7 @@ type GetKeyReq struct { func (x *GetKeyReq) Reset() { *x = GetKeyReq{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[31] + mi := &file_protobuf_avs_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2569,7 +2624,7 @@ func (x *GetKeyReq) String() string { func (*GetKeyReq) ProtoMessage() {} func (x *GetKeyReq) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[31] + mi := &file_protobuf_avs_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2582,7 +2637,7 @@ func (x *GetKeyReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetKeyReq.ProtoReflect.Descriptor instead. func (*GetKeyReq) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{31} + return file_protobuf_avs_proto_rawDescGZIP(), []int{32} } func (x *GetKeyReq) GetOwner() string { @@ -2617,7 +2672,7 @@ type KeyResp struct { func (x *KeyResp) Reset() { *x = KeyResp{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[32] + mi := &file_protobuf_avs_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2630,7 +2685,7 @@ func (x *KeyResp) String() string { func (*KeyResp) ProtoMessage() {} func (x *KeyResp) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[32] + mi := &file_protobuf_avs_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2643,7 +2698,7 @@ func (x *KeyResp) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyResp.ProtoReflect.Descriptor instead. func (*KeyResp) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{32} + return file_protobuf_avs_proto_rawDescGZIP(), []int{33} } func (x *KeyResp) GetKey() string { @@ -2675,7 +2730,7 @@ type TriggerMetadata struct { func (x *TriggerMetadata) Reset() { *x = TriggerMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[33] + mi := &file_protobuf_avs_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2688,7 +2743,7 @@ func (x *TriggerMetadata) String() string { func (*TriggerMetadata) ProtoMessage() {} func (x *TriggerMetadata) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[33] + mi := &file_protobuf_avs_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2701,7 +2756,7 @@ func (x *TriggerMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use TriggerMetadata.ProtoReflect.Descriptor instead. func (*TriggerMetadata) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{33} + return file_protobuf_avs_proto_rawDescGZIP(), []int{34} } func (x *TriggerMetadata) GetBlockNumber() uint64 { @@ -2752,7 +2807,7 @@ type GetWalletReq struct { func (x *GetWalletReq) Reset() { *x = GetWalletReq{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[34] + mi := &file_protobuf_avs_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2765,7 +2820,7 @@ func (x *GetWalletReq) String() string { func (*GetWalletReq) ProtoMessage() {} func (x *GetWalletReq) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[34] + mi := &file_protobuf_avs_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2778,7 +2833,7 @@ func (x *GetWalletReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetWalletReq.ProtoReflect.Descriptor instead. func (*GetWalletReq) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{34} + return file_protobuf_avs_proto_rawDescGZIP(), []int{35} } func (x *GetWalletReq) GetSalt() string { @@ -2808,7 +2863,7 @@ type GetWalletResp struct { func (x *GetWalletResp) Reset() { *x = GetWalletResp{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[35] + mi := &file_protobuf_avs_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2821,7 +2876,7 @@ func (x *GetWalletResp) String() string { func (*GetWalletResp) ProtoMessage() {} func (x *GetWalletResp) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[35] + mi := &file_protobuf_avs_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2834,7 +2889,7 @@ func (x *GetWalletResp) ProtoReflect() protoreflect.Message { // Deprecated: Use GetWalletResp.ProtoReflect.Descriptor instead. func (*GetWalletResp) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{35} + return file_protobuf_avs_proto_rawDescGZIP(), []int{36} } func (x *GetWalletResp) GetAddress() string { @@ -2874,7 +2929,7 @@ type UserTriggerTaskReq struct { func (x *UserTriggerTaskReq) Reset() { *x = UserTriggerTaskReq{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[36] + mi := &file_protobuf_avs_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2887,7 +2942,7 @@ func (x *UserTriggerTaskReq) String() string { func (*UserTriggerTaskReq) ProtoMessage() {} func (x *UserTriggerTaskReq) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[36] + mi := &file_protobuf_avs_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2900,7 +2955,7 @@ func (x *UserTriggerTaskReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UserTriggerTaskReq.ProtoReflect.Descriptor instead. func (*UserTriggerTaskReq) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{36} + return file_protobuf_avs_proto_rawDescGZIP(), []int{37} } func (x *UserTriggerTaskReq) GetTaskId() string { @@ -2932,14 +2987,12 @@ type UserTriggerTaskResp struct { Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` // if trigger inline, the execution id will be returned ExecutionId string `protobuf:"bytes,2,opt,name=execution_id,json=executionId,proto3" json:"execution_id,omitempty"` - // when running async, we get back a job id - JobId string `protobuf:"bytes,3,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` } func (x *UserTriggerTaskResp) Reset() { *x = UserTriggerTaskResp{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[37] + mi := &file_protobuf_avs_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2952,7 +3005,7 @@ func (x *UserTriggerTaskResp) String() string { func (*UserTriggerTaskResp) ProtoMessage() {} func (x *UserTriggerTaskResp) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[37] + mi := &file_protobuf_avs_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2965,7 +3018,7 @@ func (x *UserTriggerTaskResp) ProtoReflect() protoreflect.Message { // Deprecated: Use UserTriggerTaskResp.ProtoReflect.Descriptor instead. func (*UserTriggerTaskResp) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{37} + return file_protobuf_avs_proto_rawDescGZIP(), []int{38} } func (x *UserTriggerTaskResp) GetResult() bool { @@ -2982,13 +3035,6 @@ func (x *UserTriggerTaskResp) GetExecutionId() string { return "" } -func (x *UserTriggerTaskResp) GetJobId() string { - if x != nil { - return x.JobId - } - return "" -} - type Execution_Step struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3007,7 +3053,7 @@ type Execution_Step struct { func (x *Execution_Step) Reset() { *x = Execution_Step{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[40] + mi := &file_protobuf_avs_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3020,7 +3066,7 @@ func (x *Execution_Step) String() string { func (*Execution_Step) ProtoMessage() {} func (x *Execution_Step) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[40] + mi := &file_protobuf_avs_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3112,7 +3158,7 @@ type ListTasksResp_Item struct { func (x *ListTasksResp_Item) Reset() { *x = ListTasksResp_Item{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[41] + mi := &file_protobuf_avs_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3125,7 +3171,7 @@ func (x *ListTasksResp_Item) String() string { func (*ListTasksResp_Item) ProtoMessage() {} func (x *ListTasksResp_Item) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[41] + mi := &file_protobuf_avs_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3558,128 +3604,136 @@ var file_protobuf_avs_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x22, 0x5e, 0x0a, - 0x09, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x1b, 0x0a, - 0x07, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x92, 0x02, 0x0a, 0x0f, 0x54, - 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, - 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, - 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3b, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x53, 0x0a, 0x0b, 0x54, 0x72, - 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x73, - 0x65, 0x74, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x10, 0x02, - 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x69, 0x78, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x10, 0x03, 0x12, - 0x08, 0x0a, 0x04, 0x43, 0x72, 0x6f, 0x6e, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x06, 0x22, - 0x4b, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, - 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, - 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, - 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x66, 0x0a, 0x0d, - 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, - 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, - 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x74, - 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, - 0x73, 0x6b, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, - 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x74, 0x72, 0x69, - 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, - 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0a, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x67, 0x0a, - 0x13, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, - 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x2a, 0xc8, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, - 0x00, 0x12, 0x11, 0x0a, 0x0c, 0x52, 0x70, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x10, 0xe8, 0x07, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, - 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xd0, 0x0f, 0x12, 0x16, 0x0a, - 0x11, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x10, 0xd1, 0x0f, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, - 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x70, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf0, 0x2e, 0x12, - 0x1d, 0x0a, 0x18, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4e, 0x6f, - 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf1, 0x2e, 0x12, 0x16, - 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x72, 0x72, 0x75, 0x70, - 0x74, 0x65, 0x64, 0x10, 0xd8, 0x36, 0x12, 0x19, 0x0a, 0x14, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, - 0x74, 0x61, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd9, - 0x36, 0x2a, 0x50, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x0a, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, - 0x69, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, - 0x65, 0x64, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, - 0x67, 0x10, 0x04, 0x2a, 0x20, 0x0a, 0x0e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, - 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x0a, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x10, 0x00, 0x32, 0xef, 0x05, 0x0a, 0x0a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, - 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4b, - 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, - 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, - 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x46, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x19, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x22, 0x4d, 0x0a, + 0x0f, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x5e, 0x0a, 0x09, + 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, + 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x1b, 0x0a, 0x07, + 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x92, 0x02, 0x0a, 0x0f, 0x54, 0x72, + 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, + 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x0a, + 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3b, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x53, 0x0a, 0x0b, 0x54, 0x72, 0x69, + 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x73, 0x65, + 0x74, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x10, 0x02, 0x12, + 0x0d, 0x0a, 0x09, 0x46, 0x69, 0x78, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x10, 0x03, 0x12, 0x08, + 0x0a, 0x04, 0x43, 0x72, 0x6f, 0x6e, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x06, 0x22, 0x4b, + 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, + 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, + 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x66, 0x0a, 0x0d, 0x47, + 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, + 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, + 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, + 0x6b, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x74, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x69, + 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0a, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x50, 0x0a, 0x13, + 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x2a, 0xc8, + 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x6e, 0x6b, 0x6e, + 0x6f, 0x77, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0c, 0x52, 0x70, 0x63, + 0x4e, 0x6f, 0x64, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xe8, 0x07, 0x12, 0x17, 0x0a, 0x12, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, + 0x6c, 0x65, 0x10, 0xd0, 0x0f, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd1, 0x0f, 0x12, 0x18, 0x0a, + 0x13, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x70, 0x63, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf0, 0x2e, 0x12, 0x1d, 0x0a, 0x18, 0x53, 0x6d, 0x61, 0x72, 0x74, + 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x10, 0xf1, 0x2e, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, + 0x74, 0x61, 0x43, 0x6f, 0x72, 0x72, 0x75, 0x70, 0x74, 0x65, 0x64, 0x10, 0xd8, 0x36, 0x12, 0x19, + 0x0a, 0x14, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, + 0x67, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd9, 0x36, 0x2a, 0x50, 0x0a, 0x0a, 0x54, 0x61, 0x73, + 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, + 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, 0x0c, + 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x10, 0x04, 0x2a, 0x20, 0x0a, 0x0e, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x0e, 0x0a, + 0x0a, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x10, 0x00, 0x32, 0xb5, 0x06, + 0x0a, 0x0a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x06, + 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, + 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, + 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, + 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x57, + 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, + 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x19, 0x2e, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, + 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, + 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x07, 0x47, 0x65, + 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0e, + 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, - 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, - 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, - 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x30, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, - 0x1a, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, - 0x73, 0x6b, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, - 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, - 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, - 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, - 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, - 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x61, 0x76, 0x73, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, + 0x44, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x1b, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, + 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, + 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, + 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x61, 0x76, 0x73, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3695,7 +3749,7 @@ func file_protobuf_avs_proto_rawDescGZIP() []byte { } var file_protobuf_avs_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_protobuf_avs_proto_msgTypes = make([]protoimpl.MessageInfo, 42) +var file_protobuf_avs_proto_msgTypes = make([]protoimpl.MessageInfo, 43) var file_protobuf_avs_proto_goTypes = []interface{}{ (Error)(0), // 0: aggregator.Error (TaskStatus)(0), // 1: aggregator.TaskStatus @@ -3732,26 +3786,27 @@ var file_protobuf_avs_proto_goTypes = []interface{}{ (*ListTasksResp)(nil), // 32: aggregator.ListTasksResp (*ListExecutionsReq)(nil), // 33: aggregator.ListExecutionsReq (*ListExecutionsResp)(nil), // 34: aggregator.ListExecutionsResp - (*GetKeyReq)(nil), // 35: aggregator.GetKeyReq - (*KeyResp)(nil), // 36: aggregator.KeyResp - (*TriggerMetadata)(nil), // 37: aggregator.TriggerMetadata - (*GetWalletReq)(nil), // 38: aggregator.GetWalletReq - (*GetWalletResp)(nil), // 39: aggregator.GetWalletResp - (*UserTriggerTaskReq)(nil), // 40: aggregator.UserTriggerTaskReq - (*UserTriggerTaskResp)(nil), // 41: aggregator.UserTriggerTaskResp - nil, // 42: aggregator.GraphQLQueryNode.VariablesEntry - nil, // 43: aggregator.RestAPINode.HeadersEntry - (*Execution_Step)(nil), // 44: aggregator.Execution.Step - (*ListTasksResp_Item)(nil), // 45: aggregator.ListTasksResp.Item - (*wrapperspb.BoolValue)(nil), // 46: google.protobuf.BoolValue + (*GetExecutionReq)(nil), // 35: aggregator.GetExecutionReq + (*GetKeyReq)(nil), // 36: aggregator.GetKeyReq + (*KeyResp)(nil), // 37: aggregator.KeyResp + (*TriggerMetadata)(nil), // 38: aggregator.TriggerMetadata + (*GetWalletReq)(nil), // 39: aggregator.GetWalletReq + (*GetWalletResp)(nil), // 40: aggregator.GetWalletResp + (*UserTriggerTaskReq)(nil), // 41: aggregator.UserTriggerTaskReq + (*UserTriggerTaskResp)(nil), // 42: aggregator.UserTriggerTaskResp + nil, // 43: aggregator.GraphQLQueryNode.VariablesEntry + nil, // 44: aggregator.RestAPINode.HeadersEntry + (*Execution_Step)(nil), // 45: aggregator.Execution.Step + (*ListTasksResp_Item)(nil), // 46: aggregator.ListTasksResp.Item + (*wrapperspb.BoolValue)(nil), // 47: google.protobuf.BoolValue } var file_protobuf_avs_proto_depIdxs = []int32{ 5, // 0: aggregator.TaskTrigger.fixed_time:type_name -> aggregator.FixedTimeCondition 6, // 1: aggregator.TaskTrigger.cron:type_name -> aggregator.CronCondition 7, // 2: aggregator.TaskTrigger.block:type_name -> aggregator.BlockCondition 8, // 3: aggregator.TaskTrigger.event:type_name -> aggregator.EventCondition - 42, // 4: aggregator.GraphQLQueryNode.variables:type_name -> aggregator.GraphQLQueryNode.VariablesEntry - 43, // 5: aggregator.RestAPINode.headers:type_name -> aggregator.RestAPINode.HeadersEntry + 43, // 4: aggregator.GraphQLQueryNode.variables:type_name -> aggregator.GraphQLQueryNode.VariablesEntry + 44, // 5: aggregator.RestAPINode.headers:type_name -> aggregator.RestAPINode.HeadersEntry 2, // 6: aggregator.CustomCodeNode.lang:type_name -> aggregator.CustomCodeLang 16, // 7: aggregator.BranchNode.conditions:type_name -> aggregator.Condition 10, // 8: aggregator.LoopNode.eth_transfer:type_name -> aggregator.ETHTransferNode @@ -3769,8 +3824,8 @@ var file_protobuf_avs_proto_depIdxs = []int32{ 18, // 20: aggregator.TaskNode.filter:type_name -> aggregator.FilterNode 19, // 21: aggregator.TaskNode.loop:type_name -> aggregator.LoopNode 15, // 22: aggregator.TaskNode.custom_code:type_name -> aggregator.CustomCodeNode - 37, // 23: aggregator.Execution.trigger_metadata:type_name -> aggregator.TriggerMetadata - 44, // 24: aggregator.Execution.steps:type_name -> aggregator.Execution.Step + 38, // 23: aggregator.Execution.trigger_metadata:type_name -> aggregator.TriggerMetadata + 45, // 24: aggregator.Execution.steps:type_name -> aggregator.Execution.Step 1, // 25: aggregator.Task.status:type_name -> aggregator.TaskStatus 9, // 26: aggregator.Task.trigger:type_name -> aggregator.TaskTrigger 21, // 27: aggregator.Task.nodes:type_name -> aggregator.TaskNode @@ -3779,36 +3834,38 @@ var file_protobuf_avs_proto_depIdxs = []int32{ 21, // 30: aggregator.CreateTaskReq.nodes:type_name -> aggregator.TaskNode 20, // 31: aggregator.CreateTaskReq.edges:type_name -> aggregator.TaskEdge 29, // 32: aggregator.ListWalletResp.items:type_name -> aggregator.SmartWallet - 45, // 33: aggregator.ListTasksResp.items:type_name -> aggregator.ListTasksResp.Item + 46, // 33: aggregator.ListTasksResp.items:type_name -> aggregator.ListTasksResp.Item 22, // 34: aggregator.ListExecutionsResp.items:type_name -> aggregator.Execution 3, // 35: aggregator.TriggerMetadata.type:type_name -> aggregator.TriggerMetadata.TriggerType - 37, // 36: aggregator.UserTriggerTaskReq.trigger_metadata:type_name -> aggregator.TriggerMetadata + 38, // 36: aggregator.UserTriggerTaskReq.trigger_metadata:type_name -> aggregator.TriggerMetadata 1, // 37: aggregator.ListTasksResp.Item.status:type_name -> aggregator.TaskStatus 9, // 38: aggregator.ListTasksResp.Item.trigger:type_name -> aggregator.TaskTrigger - 35, // 39: aggregator.Aggregator.GetKey:input_type -> aggregator.GetKeyReq + 36, // 39: aggregator.Aggregator.GetKey:input_type -> aggregator.GetKeyReq 26, // 40: aggregator.Aggregator.GetNonce:input_type -> aggregator.NonceRequest - 38, // 41: aggregator.Aggregator.GetWallet:input_type -> aggregator.GetWalletReq + 39, // 41: aggregator.Aggregator.GetWallet:input_type -> aggregator.GetWalletReq 28, // 42: aggregator.Aggregator.ListWallets:input_type -> aggregator.ListWalletReq 24, // 43: aggregator.Aggregator.CreateTask:input_type -> aggregator.CreateTaskReq 31, // 44: aggregator.Aggregator.ListTasks:input_type -> aggregator.ListTasksReq 4, // 45: aggregator.Aggregator.GetTask:input_type -> aggregator.IdReq 33, // 46: aggregator.Aggregator.ListExecutions:input_type -> aggregator.ListExecutionsReq - 4, // 47: aggregator.Aggregator.CancelTask:input_type -> aggregator.IdReq - 4, // 48: aggregator.Aggregator.DeleteTask:input_type -> aggregator.IdReq - 40, // 49: aggregator.Aggregator.TriggerTask:input_type -> aggregator.UserTriggerTaskReq - 36, // 50: aggregator.Aggregator.GetKey:output_type -> aggregator.KeyResp - 27, // 51: aggregator.Aggregator.GetNonce:output_type -> aggregator.NonceResp - 39, // 52: aggregator.Aggregator.GetWallet:output_type -> aggregator.GetWalletResp - 30, // 53: aggregator.Aggregator.ListWallets:output_type -> aggregator.ListWalletResp - 25, // 54: aggregator.Aggregator.CreateTask:output_type -> aggregator.CreateTaskResp - 32, // 55: aggregator.Aggregator.ListTasks:output_type -> aggregator.ListTasksResp - 23, // 56: aggregator.Aggregator.GetTask:output_type -> aggregator.Task - 34, // 57: aggregator.Aggregator.ListExecutions:output_type -> aggregator.ListExecutionsResp - 46, // 58: aggregator.Aggregator.CancelTask:output_type -> google.protobuf.BoolValue - 46, // 59: aggregator.Aggregator.DeleteTask:output_type -> google.protobuf.BoolValue - 41, // 60: aggregator.Aggregator.TriggerTask:output_type -> aggregator.UserTriggerTaskResp - 50, // [50:61] is the sub-list for method output_type - 39, // [39:50] is the sub-list for method input_type + 35, // 47: aggregator.Aggregator.GetExecution:input_type -> aggregator.GetExecutionReq + 4, // 48: aggregator.Aggregator.CancelTask:input_type -> aggregator.IdReq + 4, // 49: aggregator.Aggregator.DeleteTask:input_type -> aggregator.IdReq + 41, // 50: aggregator.Aggregator.TriggerTask:input_type -> aggregator.UserTriggerTaskReq + 37, // 51: aggregator.Aggregator.GetKey:output_type -> aggregator.KeyResp + 27, // 52: aggregator.Aggregator.GetNonce:output_type -> aggregator.NonceResp + 40, // 53: aggregator.Aggregator.GetWallet:output_type -> aggregator.GetWalletResp + 30, // 54: aggregator.Aggregator.ListWallets:output_type -> aggregator.ListWalletResp + 25, // 55: aggregator.Aggregator.CreateTask:output_type -> aggregator.CreateTaskResp + 32, // 56: aggregator.Aggregator.ListTasks:output_type -> aggregator.ListTasksResp + 23, // 57: aggregator.Aggregator.GetTask:output_type -> aggregator.Task + 34, // 58: aggregator.Aggregator.ListExecutions:output_type -> aggregator.ListExecutionsResp + 22, // 59: aggregator.Aggregator.GetExecution:output_type -> aggregator.Execution + 47, // 60: aggregator.Aggregator.CancelTask:output_type -> google.protobuf.BoolValue + 47, // 61: aggregator.Aggregator.DeleteTask:output_type -> google.protobuf.BoolValue + 42, // 62: aggregator.Aggregator.TriggerTask:output_type -> aggregator.UserTriggerTaskResp + 51, // [51:63] is the sub-list for method output_type + 39, // [39:51] is the sub-list for method input_type 39, // [39:39] is the sub-list for extension type_name 39, // [39:39] is the sub-list for extension extendee 0, // [0:39] is the sub-list for field type_name @@ -4193,7 +4250,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetKeyReq); i { + switch v := v.(*GetExecutionReq); i { case 0: return &v.state case 1: @@ -4205,7 +4262,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyResp); i { + switch v := v.(*GetKeyReq); i { case 0: return &v.state case 1: @@ -4217,7 +4274,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TriggerMetadata); i { + switch v := v.(*KeyResp); i { case 0: return &v.state case 1: @@ -4229,7 +4286,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetWalletReq); i { + switch v := v.(*TriggerMetadata); i { case 0: return &v.state case 1: @@ -4241,7 +4298,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetWalletResp); i { + switch v := v.(*GetWalletReq); i { case 0: return &v.state case 1: @@ -4253,7 +4310,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserTriggerTaskReq); i { + switch v := v.(*GetWalletResp); i { case 0: return &v.state case 1: @@ -4265,6 +4322,18 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserTriggerTaskReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protobuf_avs_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserTriggerTaskResp); i { case 0: return &v.state @@ -4276,7 +4345,7 @@ func file_protobuf_avs_proto_init() { return nil } } - file_protobuf_avs_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + file_protobuf_avs_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Execution_Step); i { case 0: return &v.state @@ -4288,7 +4357,7 @@ func file_protobuf_avs_proto_init() { return nil } } - file_protobuf_avs_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + file_protobuf_avs_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTasksResp_Item); i { case 0: return &v.state @@ -4333,7 +4402,7 @@ func file_protobuf_avs_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protobuf_avs_proto_rawDesc, NumEnums: 4, - NumMessages: 42, + NumMessages: 43, NumExtensions: 0, NumServices: 1, }, diff --git a/protobuf/avs.proto b/protobuf/avs.proto index dbda056a..0482226c 100644 --- a/protobuf/avs.proto +++ b/protobuf/avs.proto @@ -355,6 +355,11 @@ message ListExecutionsResp { bool has_more = 4; } +message GetExecutionReq { + string task_id = 1; + string execution_id = 2; +} + message GetKeyReq { string owner = 1; int64 expired_at = 2; @@ -420,8 +425,6 @@ message UserTriggerTaskResp { bool result = 1; // if trigger inline, the execution id will be returned string execution_id = 2; - // when running async, we get back a job id - string job_id = 3; } service Aggregator { @@ -438,7 +441,7 @@ service Aggregator { rpc ListTasks(ListTasksReq) returns (ListTasksResp) {}; rpc GetTask(IdReq) returns (Task) {}; rpc ListExecutions(ListExecutionsReq) returns (ListExecutionsResp) {}; - //rpc GetExecution(GetExecutionReq) returns (E) {}; + rpc GetExecution(GetExecutionReq) returns (Execution) {}; rpc CancelTask(IdReq) returns (google.protobuf.BoolValue) {}; rpc DeleteTask(IdReq) returns (google.protobuf.BoolValue) {}; diff --git a/protobuf/avs_grpc.pb.go b/protobuf/avs_grpc.pb.go index afd38c52..d3a0a0a4 100644 --- a/protobuf/avs_grpc.pb.go +++ b/protobuf/avs_grpc.pb.go @@ -34,6 +34,7 @@ type AggregatorClient interface { ListTasks(ctx context.Context, in *ListTasksReq, opts ...grpc.CallOption) (*ListTasksResp, error) GetTask(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*Task, error) ListExecutions(ctx context.Context, in *ListExecutionsReq, opts ...grpc.CallOption) (*ListExecutionsResp, error) + GetExecution(ctx context.Context, in *GetExecutionReq, opts ...grpc.CallOption) (*Execution, error) CancelTask(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) DeleteTask(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) TriggerTask(ctx context.Context, in *UserTriggerTaskReq, opts ...grpc.CallOption) (*UserTriggerTaskResp, error) @@ -119,6 +120,15 @@ func (c *aggregatorClient) ListExecutions(ctx context.Context, in *ListExecution return out, nil } +func (c *aggregatorClient) GetExecution(ctx context.Context, in *GetExecutionReq, opts ...grpc.CallOption) (*Execution, error) { + out := new(Execution) + err := c.cc.Invoke(ctx, "/aggregator.Aggregator/GetExecution", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *aggregatorClient) CancelTask(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) { out := new(wrapperspb.BoolValue) err := c.cc.Invoke(ctx, "/aggregator.Aggregator/CancelTask", in, out, opts...) @@ -161,6 +171,7 @@ type AggregatorServer interface { ListTasks(context.Context, *ListTasksReq) (*ListTasksResp, error) GetTask(context.Context, *IdReq) (*Task, error) ListExecutions(context.Context, *ListExecutionsReq) (*ListExecutionsResp, error) + GetExecution(context.Context, *GetExecutionReq) (*Execution, error) CancelTask(context.Context, *IdReq) (*wrapperspb.BoolValue, error) DeleteTask(context.Context, *IdReq) (*wrapperspb.BoolValue, error) TriggerTask(context.Context, *UserTriggerTaskReq) (*UserTriggerTaskResp, error) @@ -195,6 +206,9 @@ func (UnimplementedAggregatorServer) GetTask(context.Context, *IdReq) (*Task, er func (UnimplementedAggregatorServer) ListExecutions(context.Context, *ListExecutionsReq) (*ListExecutionsResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListExecutions not implemented") } +func (UnimplementedAggregatorServer) GetExecution(context.Context, *GetExecutionReq) (*Execution, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetExecution not implemented") +} func (UnimplementedAggregatorServer) CancelTask(context.Context, *IdReq) (*wrapperspb.BoolValue, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelTask not implemented") } @@ -361,6 +375,24 @@ func _Aggregator_ListExecutions_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Aggregator_GetExecution_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetExecutionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AggregatorServer).GetExecution(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/aggregator.Aggregator/GetExecution", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AggregatorServer).GetExecution(ctx, req.(*GetExecutionReq)) + } + return interceptor(ctx, in, info, handler) +} + func _Aggregator_CancelTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdReq) if err := dec(in); err != nil { @@ -454,6 +486,10 @@ var Aggregator_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListExecutions", Handler: _Aggregator_ListExecutions_Handler, }, + { + MethodName: "GetExecution", + Handler: _Aggregator_GetExecution_Handler, + }, { MethodName: "CancelTask", Handler: _Aggregator_CancelTask_Handler, From 6b2530322e8abea6089f421c5811fb2806473dbc Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 26 Dec 2024 16:32:06 -0800 Subject: [PATCH 05/19] set cursor to blank if no more item --- core/taskengine/engine.go | 8 ++++---- examples/example.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/taskengine/engine.go b/core/taskengine/engine.go index 14197f2f..73944fed 100644 --- a/core/taskengine/engine.go +++ b/core/taskengine/engine.go @@ -494,10 +494,10 @@ func (n *Engine) ListTasksByUser(user *model.User, payload *avsproto.ListTasksRe } } - if total >= itemPerPage { + taskResp.HasMore = visited > 0 + if taskResp.HasMore { taskResp.Cursor = NewCursor(CursorDirectionNext, taskResp.Items[total-1].Id).String() } - taskResp.HasMore = visited > 0 return taskResp, nil } @@ -681,10 +681,10 @@ func (n *Engine) ListExecutions(user *model.User, payload *avsproto.ListExecutio } } - if total >= itemPerPage { + executioResp.HasMore = visited > 0 + if executioResp.HasMore { executioResp.Cursor = NewCursor(CursorDirectionNext, executioResp.Items[total-1].Id).String() } - executioResp.HasMore = visited > 0 return executioResp, nil } diff --git a/examples/example.js b/examples/example.js index ef12153f..606f9950 100644 --- a/examples/example.js +++ b/examples/example.js @@ -127,7 +127,7 @@ async function listTask(owner, token) { for (const item of result.items) { console.log(util.inspect(item, { depth: 4, colors: true })); } - console.log(util.inspect({cursor: result.cursor}, { depth: 4, colors: true })); + console.log(util.inspect({cursor: result.cursor, hasMore: result.has_more}, { depth: 4, colors: true })); console.log("Note: we are returning only 2 items per page to demonstrate pagination") } From c5a0f365d6e506fd090e9bfea62dcb436d25a595 Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 26 Dec 2024 18:00:15 -0800 Subject: [PATCH 06/19] support filter smart wallet by factory address --- aggregator/rpc_server.go | 3 +- core/chainio/aa/aa.go | 2 +- core/taskengine/engine.go | 21 +- core/taskengine/engine_test.go | 59 +++++ protobuf/avs.pb.go | 397 +++++++++++++++++---------------- protobuf/avs.proto | 4 +- 6 files changed, 276 insertions(+), 210 deletions(-) diff --git a/aggregator/rpc_server.go b/aggregator/rpc_server.go index 4e95738e..4a77710f 100644 --- a/aggregator/rpc_server.go +++ b/aggregator/rpc_server.go @@ -53,6 +53,7 @@ func (r *RpcServer) GetWallet(ctx context.Context, payload *avsproto.GetWalletRe r.config.Logger.Info("process create wallet", "user", user.Address.String(), "salt", payload.Salt, + "factory", payload.FactoryAddress, ) return r.engine.CreateSmartWallet(user, payload) @@ -82,7 +83,7 @@ func (r *RpcServer) ListWallets(ctx context.Context, payload *avsproto.ListWalle r.config.Logger.Info("process list wallet", "address", user.Address.String(), ) - wallets, err := r.engine.GetSmartWallets(user.Address) + wallets, err := r.engine.GetSmartWallets(user.Address, payload) if err != nil { return nil, status.Errorf(codes.Unavailable, "rpc server is unavailable, retry later. %s", err.Error()) } diff --git a/core/chainio/aa/aa.go b/core/chainio/aa/aa.go index d4e93dd3..601a30de 100644 --- a/core/chainio/aa/aa.go +++ b/core/chainio/aa/aa.go @@ -77,7 +77,7 @@ func GetSenderAddressForFactory(conn *ethclient.Client, ownerAddress common.Addr } sender, err := simpleFactory.GetAddress(nil, ownerAddress, salt) - return &sender, nil + return &sender, err } func GetNonce(conn *ethclient.Client, ownerAddress common.Address, salt *big.Int) (*big.Int, error) { diff --git a/core/taskengine/engine.go b/core/taskengine/engine.go index 73944fed..646ef461 100644 --- a/core/taskengine/engine.go +++ b/core/taskengine/engine.go @@ -7,6 +7,7 @@ import ( "math/big" "slices" "strconv" + "strings" "sync" "time" @@ -139,6 +140,7 @@ func New(db storage.Storage, config *config.Config, queue *apqueue.Queue, logger } SetRpc(config.SmartWallet.EthRpcUrl) + aa.SetFactoryAddress(config.SmartWallet.FactoryAddress) //SetWsRpc(config.SmartWallet.EthWsUrl) return &e @@ -172,19 +174,21 @@ func (n *Engine) MustStart() { } } -func (n *Engine) GetSmartWallets(owner common.Address) ([]*avsproto.SmartWallet, error) { +func (n *Engine) GetSmartWallets(owner common.Address, payload *avsproto.ListWalletReq) ([]*avsproto.SmartWallet, error) { sender, err := aa.GetSenderAddress(rpcConn, owner, defaultSalt) if err != nil { return nil, status.Errorf(codes.Code(avsproto.Error_SmartWalletNotFoundError), SmartAccountCreationError) } - // This is the default wallet with our own factory - wallets := []*avsproto.SmartWallet{ - &avsproto.SmartWallet{ + wallets := []*avsproto.SmartWallet{} + + if payload == nil || payload.FactoryAddress == "" || strings.EqualFold(payload.FactoryAddress, n.smartWalletConfig.FactoryAddress.Hex()) { + // This is the default wallet with our own factory + wallets = append(wallets, &avsproto.SmartWallet{ Address: sender.String(), Factory: n.smartWalletConfig.FactoryAddress.String(), Salt: defaultSalt.String(), - }, + }) } items, err := n.db.GetByPrefix(WalletByOwnerPrefix(owner)) @@ -202,6 +206,10 @@ func (n *Engine) GetSmartWallets(owner common.Address) ([]*avsproto.SmartWallet, continue } + if payload != nil && payload.FactoryAddress != "" && !strings.EqualFold(w.Factory.String(), payload.FactoryAddress) { + continue + } + wallets = append(wallets, &avsproto.SmartWallet{ Address: w.Address.String(), Factory: w.Factory.String(), @@ -233,13 +241,10 @@ func (n *Engine) CreateSmartWallet(user *model.User, payload *avsproto.GetWallet factoryAddress = common.HexToAddress(payload.FactoryAddress) } - sender, err := aa.GetSenderAddressForFactory(rpcConn, user.Address, factoryAddress, salt) - if err != nil || sender.Hex() == "0x0000000000000000000000000000000000000000" { return nil, status.Errorf(codes.InvalidArgument, InvalidFactoryAddressError) } - wallet := &model.SmartWallet{ Owner: &user.Address, Address: sender, diff --git a/core/taskengine/engine_test.go b/core/taskengine/engine_test.go index 19330b96..415d2a0b 100644 --- a/core/taskengine/engine_test.go +++ b/core/taskengine/engine_test.go @@ -229,3 +229,62 @@ func TestGetExecution(t *testing.T) { t.Errorf("expected failure getting other user execution but succesfully read it") } } + +func TestListWallets(t *testing.T) { + db := testutil.TestMustDB() + defer storage.Destroy(db.(*storage.BadgerStorage)) + + config := testutil.GetAggregatorConfig() + n := New(db, config, nil, testutil.GetLogger()) + u := testutil.TestUser1() + + n.CreateSmartWallet(u, &avsproto.GetWalletReq{ + Salt: "12345", + }) + n.CreateSmartWallet(u, &avsproto.GetWalletReq{ + Salt: "9876", + // https://sepolia.etherscan.io/address/0x9406Cc6185a346906296840746125a0E44976454#readProxyContract + FactoryAddress: "0x9406Cc6185a346906296840746125a0E44976454", + }) + + wallets, _ := n.GetSmartWallets(u.Address, nil) + if len(wallets) <= 2 { + t.Errorf("expect 3 smartwallets but got %d", len(wallets)) + } + + // The default wallet with salt 0 + if wallets[0].Address != "0x7c3a76086588230c7B3f4839A4c1F5BBafcd57C6" { + t.Errorf("invalid smartwallet address, expect 0x7c3a76086588230c7B3f4839A4c1F5BBafcd57C6 got %s", wallets[0].Address) + } + + // This is the wallet from custom factory https://sepolia.etherscan.io/address/0x9406Cc6185a346906296840746125a0E44976454#readProxyContract + if wallets[1].Address != "0x29C3139e460d03d951070596eED3218B3cc34FD1" { + t.Errorf("invalid smartwallet address, expect 0x923A6A90E422871FC56020d560Bc0D0CF1fbb93e got %s", wallets[1].Address) + } + + // the wallet with default factory and salt 12345 + if wallets[2].Address != "0x961d2DD008960A9777571D78D21Ec9C3E5c6020c" { + t.Errorf("invalid smartwallet address, expect 0x961d2DD008960A9777571D78D21Ec9C3E5c6020c got %s", wallets[2].Address) + } + + wallets, _ = n.GetSmartWallets(u.Address, &avsproto.ListWalletReq{ + FactoryAddress: "0x9406Cc6185a346906296840746125a0E44976454", + }) + if len(wallets) != 1 { + t.Errorf("expect 1 smartwallet but got %d", len(wallets)) + } + // owner 0xD7050816337a3f8f690F8083B5Ff8019D50c0E50 salt 0 https://sepolia.etherscan.io/address/0x29adA1b5217242DEaBB142BC3b1bCfFdd56008e7#readContract + if wallets[0].Address != "0x29C3139e460d03d951070596eED3218B3cc34FD1" { + t.Errorf("invalid smartwallet address, expect 0x29C3139e460d03d951070596eED3218B3cc34FD1 got %s", wallets[0].Address) + } + + if wallets[0].Salt != "9876" { + t.Errorf("invalid smartwallet address salt, expect 9876 got %s", wallets[0].Salt) + } + + // other user will not be able to list above wallet + wallets, _ = n.GetSmartWallets(testutil.TestUser2().Address, nil) + if len(wallets) != 1 { + t.Errorf("expect only default wallet but got %d", len(wallets)) + } +} diff --git a/protobuf/avs.pb.go b/protobuf/avs.pb.go index 719d69cc..8996e4fe 100644 --- a/protobuf/avs.pb.go +++ b/protobuf/avs.pb.go @@ -2130,8 +2130,8 @@ type ListWalletReq struct { // filter out by factory address or salt // otherwise return all the wallet - Factory string `protobuf:"bytes,1,opt,name=factory,proto3" json:"factory,omitempty"` - Salt string `protobuf:"bytes,2,opt,name=salt,proto3" json:"salt,omitempty"` + FactoryAddress string `protobuf:"bytes,1,opt,name=factory_address,json=factoryAddress,proto3" json:"factory_address,omitempty"` + Salt string `protobuf:"bytes,2,opt,name=salt,proto3" json:"salt,omitempty"` } func (x *ListWalletReq) Reset() { @@ -2166,9 +2166,9 @@ func (*ListWalletReq) Descriptor() ([]byte, []int) { return file_protobuf_avs_proto_rawDescGZIP(), []int{24} } -func (x *ListWalletReq) GetFactory() string { +func (x *ListWalletReq) GetFactoryAddress() string { if x != nil { - return x.Factory + return x.FactoryAddress } return "" } @@ -3535,205 +3535,206 @@ var file_protobuf_avs_proto_rawDesc = []byte{ 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x21, 0x0a, 0x09, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3d, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, - 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, - 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x74, - 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x22, 0x55, 0x0a, 0x0b, 0x53, 0x6d, 0x61, 0x72, 0x74, - 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x73, 0x61, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x3f, - 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x2d, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6d, 0x61, - 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, - 0x7c, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x12, - 0x30, 0x0a, 0x14, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x5f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x73, - 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x74, 0x65, - 0x6d, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0b, 0x69, 0x74, 0x65, 0x6d, 0x50, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0x9b, 0x04, - 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x34, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, - 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, - 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x19, 0x0a, - 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x1a, 0xa0, 0x03, 0x0a, 0x04, 0x49, 0x74, 0x65, - 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x6d, 0x61, 0x72, 0x74, - 0x5f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, - 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, - 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, - 0x78, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x27, 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, - 0x5f, 0x72, 0x61, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, - 0x61, 0x73, 0x74, 0x52, 0x61, 0x6e, 0x41, 0x74, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x67, - 0x67, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x72, 0x69, 0x67, 0x67, - 0x65, 0x72, 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x22, 0x6a, 0x0a, 0x11, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, - 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, - 0x73, 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x65, 0x72, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x74, 0x65, 0x6d, - 0x50, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0x74, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, - 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, - 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x22, 0x4d, 0x0a, - 0x0f, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x5e, 0x0a, 0x09, - 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, - 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x1b, 0x0a, 0x07, - 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x92, 0x02, 0x0a, 0x0f, 0x54, 0x72, - 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, - 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x0a, - 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3b, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x53, 0x0a, 0x0b, 0x54, 0x72, 0x69, - 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x73, 0x65, - 0x74, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x10, 0x02, 0x12, - 0x0d, 0x0a, 0x09, 0x46, 0x69, 0x78, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x10, 0x03, 0x12, 0x08, - 0x0a, 0x04, 0x43, 0x72, 0x6f, 0x6e, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x06, 0x22, 0x4b, - 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, - 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, - 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, - 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x66, 0x0a, 0x0d, 0x47, - 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, - 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, - 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, - 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, - 0x6b, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, - 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x74, 0x72, 0x69, 0x67, - 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x69, - 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x50, 0x0a, 0x13, - 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x2a, 0xc8, - 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x6e, 0x6b, 0x6e, - 0x6f, 0x77, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0c, 0x52, 0x70, 0x63, - 0x4e, 0x6f, 0x64, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xe8, 0x07, 0x12, 0x17, 0x0a, 0x12, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x6c, 0x65, 0x10, 0xd0, 0x0f, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd1, 0x0f, 0x12, 0x18, 0x0a, - 0x13, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x70, 0x63, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf0, 0x2e, 0x12, 0x1d, 0x0a, 0x18, 0x53, 0x6d, 0x61, 0x72, 0x74, - 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x10, 0xf1, 0x2e, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, - 0x74, 0x61, 0x43, 0x6f, 0x72, 0x72, 0x75, 0x70, 0x74, 0x65, 0x64, 0x10, 0xd8, 0x36, 0x12, 0x19, - 0x0a, 0x14, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, - 0x67, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd9, 0x36, 0x2a, 0x50, 0x0a, 0x0a, 0x54, 0x61, 0x73, - 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, - 0x65, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, - 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, 0x0c, - 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x10, 0x04, 0x2a, 0x20, 0x0a, 0x0e, 0x43, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x0e, 0x0a, - 0x0a, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x10, 0x00, 0x32, 0xb5, 0x06, - 0x0a, 0x0a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x06, - 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, - 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, - 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, - 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x57, - 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x19, 0x2e, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, - 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, + 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x4c, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, + 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, + 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x22, 0x55, 0x0a, 0x0b, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, + 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, + 0x61, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x3f, 0x0a, + 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x2d, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6d, 0x61, 0x72, + 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x7c, + 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x12, 0x30, + 0x0a, 0x14, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x5f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x73, 0x6d, + 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x74, 0x65, 0x6d, + 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0b, 0x69, 0x74, 0x65, 0x6d, 0x50, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0x9b, 0x04, 0x0a, + 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, + 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, - 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x07, 0x47, 0x65, - 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0e, - 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, - 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, + 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, + 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x1a, 0xa0, 0x03, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x5f, + 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x6f, + 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x78, + 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, + 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, + 0x72, 0x61, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x61, + 0x73, 0x74, 0x52, 0x61, 0x6e, 0x41, 0x74, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, + 0x72, 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x22, 0x6a, 0x0a, 0x11, 0x4c, 0x69, + 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x12, + 0x19, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, + 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, + 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x70, + 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x74, 0x65, 0x6d, 0x50, + 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0x74, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, + 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, + 0x72, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x22, 0x4d, 0x0a, 0x0f, + 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, + 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x5e, 0x0a, 0x09, 0x47, + 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1d, + 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x1b, 0x0a, 0x07, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x92, 0x02, 0x0a, 0x0f, 0x54, 0x72, 0x69, + 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x0a, 0x07, + 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, + 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3b, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x53, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x73, 0x65, 0x74, + 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x10, 0x02, 0x12, 0x0d, + 0x0a, 0x09, 0x46, 0x69, 0x78, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x10, 0x03, 0x12, 0x08, 0x0a, + 0x04, 0x43, 0x72, 0x6f, 0x6e, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x06, 0x22, 0x4b, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, + 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, + 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x66, 0x0a, 0x0d, 0x47, 0x65, + 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, + 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, + 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, + 0x49, 0x64, 0x12, 0x46, 0x0a, 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x74, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0a, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x50, 0x0a, 0x13, 0x55, + 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x2a, 0xc8, 0x01, + 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, + 0x77, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0c, 0x52, 0x70, 0x63, 0x4e, + 0x6f, 0x64, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xe8, 0x07, 0x12, 0x17, 0x0a, 0x12, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, + 0x65, 0x10, 0xd0, 0x0f, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x57, + 0x72, 0x69, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd1, 0x0f, 0x12, 0x18, 0x0a, 0x13, + 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x70, 0x63, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x10, 0xf0, 0x2e, 0x12, 0x1d, 0x0a, 0x18, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, + 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x10, 0xf1, 0x2e, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, + 0x61, 0x43, 0x6f, 0x72, 0x72, 0x75, 0x70, 0x74, 0x65, 0x64, 0x10, 0xd8, 0x36, 0x12, 0x19, 0x0a, + 0x14, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd9, 0x36, 0x2a, 0x50, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x10, + 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x12, 0x0c, 0x0a, + 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x10, 0x04, 0x2a, 0x20, 0x0a, 0x0e, 0x43, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x0a, + 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x10, 0x00, 0x32, 0xb5, 0x06, 0x0a, + 0x0a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x47, + 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, + 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, + 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, + 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, + 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x45, + 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x19, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, + 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, + 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x07, 0x47, 0x65, 0x74, + 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x44, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x1b, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x61, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, - 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x44, + 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, + 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, - 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x61, 0x76, 0x73, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, + 0x6b, 0x12, 0x11, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x49, + 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, + 0x6b, 0x12, 0x1e, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, + 0x71, 0x1a, 0x1f, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x61, 0x76, 0x73, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protobuf/avs.proto b/protobuf/avs.proto index 0482226c..4d327af6 100644 --- a/protobuf/avs.proto +++ b/protobuf/avs.proto @@ -291,8 +291,8 @@ message NonceResp { message ListWalletReq { // filter out by factory address or salt // otherwise return all the wallet - string factory = 1; - string salt = 2; + string factory_address = 1; + string salt = 2; } message SmartWallet { From e7f17be15e4d880b4b8f8a5f9e9efe2fcfc5e442 Mon Sep 17 00:00:00 2001 From: Vinh Date: Wed, 11 Dec 2024 21:29:01 -0800 Subject: [PATCH 07/19] rename TriggerMark -> TriggerMetadata --- core/taskengine/engine.go | 1 - core/taskengine/executor.go | 1 - 2 files changed, 2 deletions(-) diff --git a/core/taskengine/engine.go b/core/taskengine/engine.go index 646ef461..2b1bf010 100644 --- a/core/taskengine/engine.go +++ b/core/taskengine/engine.go @@ -563,7 +563,6 @@ func (n *Engine) TriggerTask(user *model.User, payload *avsproto.UserTriggerTask if payload.IsBlocking { // Run the task inline, by pass the queue system executor := NewExecutor(n.db, n.logger) - fmt.Println("metadata", payload.TriggerMetadata) execution, err := executor.RunTask(task, payload.TriggerMetadata) if err == nil { return &avsproto.UserTriggerTaskResp{ diff --git a/core/taskengine/executor.go b/core/taskengine/executor.go index b482751a..f183e601 100644 --- a/core/taskengine/executor.go +++ b/core/taskengine/executor.go @@ -73,7 +73,6 @@ func (x *TaskExecutor) Perform(job *apqueue.Job) error { func (x *TaskExecutor) RunTask(task *model.Task, triggerMetadata *avsproto.TriggerMetadata) (*avsproto.Execution, error) { vm, err := NewVMWithData(task.Id, triggerMetadata, task.Nodes, task.Edges) - initialTaskStatus := task.Status if err != nil { From d21ec3668b7181d522f869aebc45f0716d52919e Mon Sep 17 00:00:00 2001 From: Vinh Date: Wed, 11 Dec 2024 21:32:55 -0800 Subject: [PATCH 08/19] rename more files --- examples/static_codegen/avs_pb.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/static_codegen/avs_pb.js b/examples/static_codegen/avs_pb.js index a24668a7..f8f8ac66 100644 --- a/examples/static_codegen/avs_pb.js +++ b/examples/static_codegen/avs_pb.js @@ -7172,7 +7172,7 @@ proto.aggregator.ListWalletReq.prototype.toObject = function(opt_includeInstance */ proto.aggregator.ListWalletReq.toObject = function(includeInstance, msg) { var f, obj = { - factory: jspb.Message.getFieldWithDefault(msg, 1, ""), + factoryAddress: jspb.Message.getFieldWithDefault(msg, 1, ""), salt: jspb.Message.getFieldWithDefault(msg, 2, "") }; @@ -7212,7 +7212,7 @@ proto.aggregator.ListWalletReq.deserializeBinaryFromReader = function(msg, reade switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setFactory(value); + msg.setFactoryAddress(value); break; case 2: var value = /** @type {string} */ (reader.readString()); @@ -7247,7 +7247,7 @@ proto.aggregator.ListWalletReq.prototype.serializeBinary = function() { */ proto.aggregator.ListWalletReq.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getFactory(); + f = message.getFactoryAddress(); if (f.length > 0) { writer.writeString( 1, @@ -7265,10 +7265,10 @@ proto.aggregator.ListWalletReq.serializeBinaryToWriter = function(message, write /** - * optional string factory = 1; + * optional string factory_address = 1; * @return {string} */ -proto.aggregator.ListWalletReq.prototype.getFactory = function() { +proto.aggregator.ListWalletReq.prototype.getFactoryAddress = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -7277,7 +7277,7 @@ proto.aggregator.ListWalletReq.prototype.getFactory = function() { * @param {string} value * @return {!proto.aggregator.ListWalletReq} returns this */ -proto.aggregator.ListWalletReq.prototype.setFactory = function(value) { +proto.aggregator.ListWalletReq.prototype.setFactoryAddress = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; From ad812421abe49b90a614e0af7c687456448e559b Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 12 Dec 2024 09:03:02 -0800 Subject: [PATCH 09/19] implement accessing to previous node data --- core/taskengine/executor.go | 5 + core/taskengine/vm.go | 162 ++++++++++++++------- core/taskengine/vm_runner_contract_read.go | 7 +- core/taskengine/vm_runner_graphql_query.go | 13 +- core/taskengine/vm_runner_rest.go | 19 ++- examples/example.js | 115 ++++++++++++++- 6 files changed, 261 insertions(+), 60 deletions(-) diff --git a/core/taskengine/executor.go b/core/taskengine/executor.go index f183e601..9fd69d14 100644 --- a/core/taskengine/executor.go +++ b/core/taskengine/executor.go @@ -73,6 +73,11 @@ func (x *TaskExecutor) Perform(job *apqueue.Job) error { func (x *TaskExecutor) RunTask(task *model.Task, triggerMetadata *avsproto.TriggerMetadata) (*avsproto.Execution, error) { vm, err := NewVMWithData(task.Id, triggerMetadata, task.Nodes, task.Edges) + if err != nil { + return nil, err + } + + vm.WithLogger(x.logger) initialTaskStatus := task.Status if err != nil { diff --git a/core/taskengine/vm.go b/core/taskengine/vm.go index 07068e91..539a0a94 100644 --- a/core/taskengine/vm.go +++ b/core/taskengine/vm.go @@ -7,6 +7,7 @@ import ( "sync" "time" + sdklogging "github.com/Layr-Labs/eigensdk-go/logging" "github.com/dop251/goja" "github.com/ginkgoch/godash/v2" @@ -36,6 +37,19 @@ type Step struct { Next []string } +type CommonProcessor struct { + vm *VM +} + +func (c *CommonProcessor) SetVar(name string, data any) { + c.vm.AddVar(name, data) +} + +// Set the variable for step output so it can be refer and use in subsequent steps +func (c *CommonProcessor) SetOutputVarForStep(stepID string, data any) { + c.vm.AddVar(c.vm.GetNodeNameAsVar(stepID), data) +} + // The VM is the core component that load the node information and execute them, yield finaly result type VM struct { // Input raw task data @@ -55,16 +69,18 @@ type VM struct { plans map[string]*Step entrypoint string instructionCount int64 + + logger sdklogging.Logger } -func NewVM() (*VM, error) { +func NewVM() *VM { v := &VM{ Status: VMStateInitialize, mu: &sync.Mutex{}, instructionCount: 0, } - return v, nil + return v } func (v *VM) Reset() { @@ -75,6 +91,17 @@ func (v *VM) Reset() { v.instructionCount = 0 } +func (v *VM) WithLogger(logger sdklogging.Logger) *VM { + v.logger = logger + + return v +} + +func (v *VM) GetNodeNameAsVar(nodeID string) string { + name := v.TaskNodes[nodeID].Name + return name +} + func NewVMWithData(taskID string, triggerMetadata *avsproto.TriggerMetadata, nodes []*avsproto.TaskNode, edges []*avsproto.TaskEdge) (*VM, error) { v := &VM{ Status: VMStateInitialize, @@ -92,59 +119,67 @@ func NewVMWithData(taskID string, triggerMetadata *avsproto.TriggerMetadata, nod v.vars = macros.GetEnvs(map[string]any{}) // popular trigger data for trigger variable - if triggerMetadata != nil && triggerMetadata.LogIndex > 0 && triggerMetadata.TxHash != "" { - // if it contains event, we need to fetch and pop - receipt, err := rpcConn.TransactionReceipt(context.Background(), common.HexToHash(triggerMetadata.TxHash)) - if err != nil { - return nil, err - } + if triggerMetadata != nil { + if triggerMetadata.LogIndex > 0 && triggerMetadata.TxHash != "" { + // if it contains event, we need to fetch and pop + receipt, err := rpcConn.TransactionReceipt(context.Background(), common.HexToHash(triggerMetadata.TxHash)) + if err != nil { + return nil, err + } + + var event *types.Log + //event := receipt.Logs[triggerMetadata.LogIndex] - var event *types.Log - //event := receipt.Logs[triggerMetadata.LogIndex] + for _, l := range receipt.Logs { + if uint64(l.Index) == triggerMetadata.LogIndex { + event = l + } + } - for _, l := range receipt.Logs { - if uint64(l.Index) == triggerMetadata.LogIndex { - event = l + if event == nil { + return nil, fmt.Errorf("tx %s doesn't content event %d", triggerMetadata.TxHash, triggerMetadata.LogIndex) } - } - if event == nil { - return nil, fmt.Errorf("tx %s doesn't content event %d", triggerMetadata.TxHash, triggerMetadata.LogIndex) - } + tokenMetadata, err := GetMetadataForTransfer(event) + ef, err := erc20.NewErc20(event.Address, nil) - tokenMetadata, err := GetMetadataForTransfer(event) - ef, err := erc20.NewErc20(event.Address, nil) + blockHeader, err := GetBlock(event.BlockNumber) + if err != nil { + return nil, fmt.Errorf("RPC error getting block header. Retry: %w", err) + } - blockHeader, err := GetBlock(event.BlockNumber) - if err != nil { - return nil, fmt.Errorf("RPC error getting block header. Retry: %w", err) + parseTransfer, err := ef.ParseTransfer(*event) + formattedValue := ToDecimal(parseTransfer.Value, int(tokenMetadata.Decimals)).String() + + // TODO: Implement a decoder to help standarize common event + v.vars["trigger1"] = map[string]interface{}{ + "data": map[string]interface{}{ + "topics": godash.Map(event.Topics, func(topic common.Hash) string { + return "0x" + strings.ToLower(strings.TrimLeft(topic.String(), "0x0")) + }), + "data": "0x" + common.Bytes2Hex(event.Data), + + "token_name": tokenMetadata.Name, + "token_symbol": tokenMetadata.Symbol, + "token_decimals": tokenMetadata.Decimals, + "transaction_hash": event.TxHash, + "address": strings.ToLower(event.Address.Hex()), + "block_number": event.BlockNumber, + "block_timestamp": blockHeader.Time, + "from_address": parseTransfer.From.String(), + "to_address": parseTransfer.To.String(), + "value": parseTransfer.Value.String(), + "value_formatted": formattedValue, + "transaction_index": event.TxIndex, + }, + } } - parseTransfer, err := ef.ParseTransfer(*event) - formattedValue := ToDecimal(parseTransfer.Value, int(tokenMetadata.Decimals)).String() - - v.vars["trigger1"] = map[string]interface{}{ - "data": map[string]interface{}{ - "topics": godash.Map(event.Topics, func(topic common.Hash) string { - return "0x" + strings.ToLower(strings.TrimLeft(topic.String(), "0x0")) - }), - "data": "0x" + common.Bytes2Hex(event.Data), - - "token_name": tokenMetadata.Name, - "token_symbol": tokenMetadata.Symbol, - "token_decimals": tokenMetadata.Decimals, - "transaction_hash": event.TxHash, - "address": strings.ToLower(event.Address.Hex()), - "block_number": event.BlockNumber, - "block_timestamp": blockHeader.Time, - "from_address": parseTransfer.From.String(), - "to_address": parseTransfer.To.String(), - "value": parseTransfer.Value.String(), - "value_formatted": formattedValue, - "transaction_index": event.TxIndex, - }, + if triggerMetadata.Epoch > 0 { + v.vars["trigger1"] = map[string]any{ + "epoch": triggerMetadata.Epoch, + } } - } return v, nil @@ -244,24 +279,29 @@ func (v *VM) executeNode(node *avsproto.TaskNode) (*avsproto.Execution_Step, err if nodeValue := node.GetRestApi(); nodeValue != nil { // TODO: refactor into function - p := NewRestProrcessor() + p := NewRestProrcessor(v) // only evaluate string when there is string interpolation - if nodeValue.Body != "" && strings.Contains(nodeValue.Body, "$") { + if nodeValue.Body != "" && (strings.Contains(nodeValue.Body, "$") || strings.Contains(nodeValue.Body, "`")) { nodeValue2 := &avsproto.RestAPINode{ Url: macros.RenderString(nodeValue.Url, macroEnvs), Headers: nodeValue.Headers, Method: nodeValue.Method, Body: strings.Clone(nodeValue.Body), } - vm := goja.New() - // TODO: dynamically set var instead of hardcode the name - // client would need to send this over - vm.Set("trigger1", v.vars["trigger1"]) + jsvm := goja.New() - renderBody, err := vm.RunString(nodeValue.Body) + for key, value := range v.vars { + jsvm.Set(key, map[string]any{ + "data": value, + }) + } + + renderBody, err := jsvm.RunString(nodeValue.Body) if err == nil { nodeValue2.Body = renderBody.Export().(string) + } else { + fmt.Println("error render string with goja", err) } executionLog, err = p.Execute(node.Id, nodeValue2) } else { @@ -289,11 +329,27 @@ func (v *VM) executeNode(node *avsproto.TaskNode) (*avsproto.Execution_Step, err } } } + } else if nodeValue := node.GetGraphqlQuery(); nodeValue != nil { + executionLog, err = v.runGraphQL(node.Id, nodeValue) } return executionLog, err } +func (v *VM) runGraphQL(stepID string, node *avsproto.GraphQLQueryNode) (*avsproto.Execution_Step, error) { + g, err := NewGraphqlQueryProcessor(v, node.Url) + if err != nil { + return nil, err + } + executionLog, _, err := g.Execute(stepID, node) + if err != nil { + v.logger.Error("error execute graphql node", "task_id", v.TaskID, "step", stepID, "url", node.Url, "error", err) + } + v.ExecutionLogs = append(v.ExecutionLogs, executionLog) + + return executionLog, nil +} + func (v *VM) runBranch(stepID string, node *avsproto.BranchNode) (*avsproto.Execution_Step, string, error) { t0 := time.Now() s := &avsproto.Execution_Step{ diff --git a/core/taskengine/vm_runner_contract_read.go b/core/taskengine/vm_runner_contract_read.go index 9b2f6916..0b2e5bce 100644 --- a/core/taskengine/vm_runner_contract_read.go +++ b/core/taskengine/vm_runner_contract_read.go @@ -16,12 +16,16 @@ import ( ) type ContractReadProcessor struct { + *CommonProcessor client *ethclient.Client } -func NewContractReadProcessor(client *ethclient.Client) *ContractReadProcessor { +func NewContractReadProcessor(vm *VM, client *ethclient.Client) *ContractReadProcessor { return &ContractReadProcessor{ client: client, + CommonProcessor: &CommonProcessor{ + vm: vm, + }, } } @@ -81,6 +85,7 @@ func (r *ContractReadProcessor) Execute(stepID string, node *avsproto.ContractRe s.Log = log.String() outputData, err := json.Marshal(result) s.OutputData = string(outputData) + r.SetOutputVarForStep(stepID, outputData) if err != nil { s.Success = false s.Error = err.Error() diff --git a/core/taskengine/vm_runner_graphql_query.go b/core/taskengine/vm_runner_graphql_query.go index e4a8b5dd..186b88d3 100644 --- a/core/taskengine/vm_runner_graphql_query.go +++ b/core/taskengine/vm_runner_graphql_query.go @@ -13,12 +13,14 @@ import ( ) type GraphqlQueryProcessor struct { + *CommonProcessor + client *graphql.Client sb *strings.Builder url *url.URL } -func NewGraphqlQueryProcessor(endpoint string) (*GraphqlQueryProcessor, error) { +func NewGraphqlQueryProcessor(vm *VM, endpoint string) (*GraphqlQueryProcessor, error) { sb := &strings.Builder{} log := func(s string) { fmt.Println("LOGLOG", s) @@ -39,10 +41,12 @@ func NewGraphqlQueryProcessor(endpoint string) (*GraphqlQueryProcessor, error) { client: client, sb: sb, url: u, + + CommonProcessor: &CommonProcessor{vm}, }, nil } -func (r *GraphqlQueryProcessor) Execute(stepID string, node *avsproto.GraphQLQueryNode) (*avsproto.Execution_Step, error) { +func (r *GraphqlQueryProcessor) Execute(stepID string, node *avsproto.GraphQLQueryNode) (*avsproto.Execution_Step, any, error) { ctx := context.Background() t0 := time.Now().Unix() step := &avsproto.Execution_Step{ @@ -68,11 +72,12 @@ func (r *GraphqlQueryProcessor) Execute(stepID string, node *avsproto.GraphQLQue query := graphql.NewRequest(node.Query) err = r.client.Run(ctx, query, &resp) if err != nil { - return step, err + return step, nil, err } step.Log = r.sb.String() data, err := json.Marshal(resp) step.OutputData = string(data) - return step, err + r.SetOutputVarForStep(stepID, resp) + return step, resp, err } diff --git a/core/taskengine/vm_runner_rest.go b/core/taskengine/vm_runner_rest.go index 47c098af..5b873703 100644 --- a/core/taskengine/vm_runner_rest.go +++ b/core/taskengine/vm_runner_rest.go @@ -1,6 +1,7 @@ package taskengine import ( + "encoding/json" "fmt" "net/url" "strings" @@ -12,10 +13,11 @@ import ( ) type RestProcessor struct { + *CommonProcessor client *resty.Client } -func NewRestProrcessor() *RestProcessor { +func NewRestProrcessor(vm *VM) *RestProcessor { client := resty.New() // Unique settings at Client level @@ -28,6 +30,9 @@ func NewRestProrcessor() *RestProcessor { r := RestProcessor{ client: client, + CommonProcessor: &CommonProcessor{ + vm: vm, + }, } return &r @@ -83,6 +88,18 @@ func (r *RestProcessor) Execute(stepID string, node *avsproto.RestAPINode) (*avs s.Log = log.String() s.OutputData = string(resp.Body()) + // Attempt to detect json + if s.OutputData[0] == '{' || s.OutputData[0] == '[' { + var parseData map[string]any + if err := json.Unmarshal([]byte(s.OutputData), &parseData); err == nil { + r.SetOutputVarForStep(stepID, parseData) + } else { + r.SetOutputVarForStep(stepID, s.OutputData) + } + } else { + r.SetOutputVarForStep(stepID, s.OutputData) + } + if err != nil { s.Success = false s.Error = err.Error() diff --git a/examples/example.js b/examples/example.js index 606f9950..1edda884 100644 --- a/examples/example.js +++ b/examples/example.js @@ -301,6 +301,9 @@ const main = async (cmd) => { case "schedule-monitor": scheduleMonitor(owner, token, process.argv[3]); break; + case "schedule-aave": + scheduleAaveMonitor(owner, token); + break; case "schedule": case "schedule-cron": case "schedule-event": @@ -384,7 +387,6 @@ const main = async (cmd) => { case "delete": await deleteTask(owner, token, process.argv[3]); break; - case "wallet": await getWallets(owner, token); break; @@ -413,6 +415,7 @@ const main = async (cmd) => { schedule-cron : to schedule a task that run on cron schedule-event : to schedule a task that run on occurenct of an event schedule-generic: to schedule a task with an arbitrary contract query + schedule-aave: monitor and report aavee liquidity rate every block monitor-address : to monitor erc20 in/out for an address trigger : manually trigger a task. Example: trigger abcdef '{"block_number":1234}' for blog trigger @@ -674,6 +677,116 @@ async function scheduleMonitor(owner, token, target) { return result; } +// setup a task to monitor in/out transfer for a wallet and send notification +async function scheduleAaveMonitor(owner, token) { + const wallets = await getWallets(owner, token); + const smartWalletAddress = wallets[0].address; + + const metadata = new grpc.Metadata(); + metadata.add("authkey", token); + + let trigger = { + name: "trigger1", + block: { + interval: 1, + }, + }; + + const getReserveId = UlidMonotonic.generate().toCanonical(); + const sendSummaryId = UlidMonotonic.generate().toCanonical(); + const getIpId = UlidMonotonic.generate().toCanonical(); + + const result = await asyncRPC( + client, + "CreateTask", + { + smart_wallet_address: smartWalletAddress, + nodes: [ + { + id: getReserveId, + name: 'getReserveUSDC', + graphql_query: { + url: 'https://gateway.thegraph.com/api/10186dcf11921c7d1bc140721c69da38/subgraphs/id/Cd2gEDVeqnjBn1hSeqFMitw8Q1iiyV9FYUZkLNRcL87g', + query: ` + { + reserves(where: {underlyingAsset: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}) { + id + underlyingAsset + name + decimals + liquidityRate + aToken { + id + } + sToken { + id + } + } + } + ` + } + }, + { + id: getIpId, + name: 'getIpAddress', + rest_api: { + url: 'https://ipinfo.io/json', + } + }, + + { + id: sendSummaryId, + name: 'notification', + rest_api: { + url: "https://api.telegram.org/bot{{notify_bot_token}}/sendMessage?", + //url: `https://webhook.site/ca416047-5ba0-4485-8f98-76790b63add7`, + method: "POST", + body: `JSON.stringify({ + chat_id:-4609037622, + text: \`Node IP is: \${getIpAddress.data.ip}.\nCurrent USDC liquidity rate in RAY unit is \${getReserveUSDC.data.reserves[0].liquidityRate} \` + })`, + headers: { + "content-type": "application/json" + } + } + }, + ], + + edges: [ + { + id: UlidMonotonic.generate().toCanonical(), + // __TRIGGER__ is a special node. It doesn't appear directly in the task data, but it should be draw on the UI to show what is the entrypoint + source: "__TRIGGER__", + target: getIpId, + }, + { + id: UlidMonotonic.generate().toCanonical(), + // __TRIGGER__ is a special node. It doesn't appear directly in the task data, but it should be draw on the UI to show what is the entrypoint + source: getIpId, + target: getReserveId, + }, + { + id: UlidMonotonic.generate().toCanonical(), + // __TRIGGER__ is a special node. It doesn't appear directly in the task data, but it should be draw on the UI to show what is the entrypoint + source: getReserveId, + target: sendSummaryId, + }, + ], + + trigger, + start_at: Math.floor(Date.now() / 1000) + 30, + expired_at: Math.floor(Date.now() / 1000 + 3600 * 24 * 30), + memo: `Montoring USDC aavee on ethereum`, + }, + metadata + ); + + console.log("create task", result); + + return result; +} + + (async () => { try { main(process.argv[2]); From 76c2bcd03e51ad46bf47f3fbd8c0d5e069a0d436 Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 27 Dec 2024 01:51:37 -0800 Subject: [PATCH 10/19] migrate trigger from expr -> goja --- core/taskengine/trigger/event.go | 35 +++++++++------------------ core/taskengine/trigger/event_test.go | 33 +++++++------------------ 2 files changed, 20 insertions(+), 48 deletions(-) diff --git a/core/taskengine/trigger/event.go b/core/taskengine/trigger/event.go index 5c46266d..e43df7a7 100644 --- a/core/taskengine/trigger/event.go +++ b/core/taskengine/trigger/event.go @@ -7,8 +7,7 @@ import ( "github.com/AvaProtocol/ap-avs/core/taskengine/macros" sdklogging "github.com/Layr-Labs/eigensdk-go/logging" - "github.com/expr-lang/expr" - "github.com/expr-lang/expr/vm" + "github.com/dop251/goja" "github.com/ginkgoch/godash/v2" "github.com/ethereum/go-ethereum" @@ -26,7 +25,7 @@ type EventMark struct { } type Check struct { - Program *vm.Program + Program string TaskMetadata *avsproto.SyncMessagesResp_TaskMetadata } @@ -71,24 +70,7 @@ func NewEventTrigger(o *RpcOption, triggerCh chan TriggerMetadata[EventMark]) *E // TODO: track remainExecution and expriedAt before merge func (t *EventTrigger) AddCheck(check *avsproto.SyncMessagesResp_TaskMetadata) error { - // Dummy value to get type - envs := macros.GetEnvs(map[string]interface{}{ - "trigger1": map[string]interface{}{ - "data": map[string]interface{}{ - "address": "dummy", - "topics": godash.Map([]common.Hash{}, func(topic common.Hash) string { - return "0x" - }), - "data": "0x", - "tx_hash": "dummy", - }, - }, - }) - program, err := expr.Compile(check.GetTrigger().GetEvent().GetExpression(), expr.Env(envs), expr.AsBool()) - if err != nil { - return err - } - + program := check.GetTrigger().GetEvent().GetExpression() t.checks.Store(check.TaskId, &Check{ Program: program, TaskMetadata: check, @@ -167,7 +149,8 @@ func (evt *EventTrigger) Run(ctx context.Context) error { return err } -func (evt *EventTrigger) Evaluate(event *types.Log, program *vm.Program) (bool, error) { +func (evt *EventTrigger) Evaluate(event *types.Log, program string) (bool, error) { + jsvm := goja.New() envs := macros.GetEnvs(map[string]interface{}{ "trigger1": map[string]interface{}{ "data": map[string]interface{}{ @@ -180,12 +163,16 @@ func (evt *EventTrigger) Evaluate(event *types.Log, program *vm.Program) (bool, }, }, }) + for k, v := range envs { + jsvm.Set(k, v) + } - result, err := expr.Run(program, envs) + //result, err := expr.Run(program, envs) + result, err := jsvm.RunString(program) if err != nil { return false, err } - return result.(bool), err + return result.Export().(bool), err } diff --git a/core/taskengine/trigger/event_test.go b/core/taskengine/trigger/event_test.go index a9571541..a225bb7e 100644 --- a/core/taskengine/trigger/event_test.go +++ b/core/taskengine/trigger/event_test.go @@ -3,9 +3,7 @@ package trigger import ( "testing" - "github.com/AvaProtocol/ap-avs/core/taskengine/macros" "github.com/AvaProtocol/ap-avs/core/testutil" - "github.com/expr-lang/expr" ) func TestChainlinkLatestAnswer(t *testing.T) { @@ -20,35 +18,22 @@ func TestChainlinkLatestAnswer(t *testing.T) { WsRpcURL: testutil.GetTestRPCURL(), }, make(chan TriggerMetadata[EventMark], 1000)) - envs := macros.GetEnvs(map[string]interface{}{ - "trigger1": map[string]interface{}{ - "data": map[string]interface{}{ - "topics": []string{ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0xabcdef", - "0xc114fb059434563dc65ac8d57e7976e3eac534f4", - }, - }, - }, - }) - - program, err := expr.Compile(` - trigger1.data.topics[0] == "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" && trigger1.data.topics[2] == "0xc114fb059434563dc65ac8d57e7976e3eac534f4" - `, expr.Env(envs), expr.AsBool()) - - if err != nil { - panic(err) - } + program := `trigger1.data.topics[0] == "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" && trigger1.data.topics[2] == "0xc114fb059434563dc65ac8d57e7976e3eac534f4"` result, err := eventTrigger.Evaluate(event, program) if !result { t.Errorf("expect expression to be match, but got false: error: %v", err) } - program, err = expr.Compile(` - (trigger1.data.topics[0] == "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" && trigger1.data.topics[2] == "abc") - `) + program = `trigger1.data.topics[0] == "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" && trigger1.data.topics[2] == "abc"` + + result, err = eventTrigger.Evaluate(event, program) + if result { + t.Errorf("expect expression to be not match, but got match: error: %v", err) + } + event, err = testutil.GetEventForTx("0x8f7c1f698f03d6d32c996b679ea1ebad45bbcdd9aa95d250dda74763cc0f508d", 81) + program = `trigger1.data.address == "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789" && trigger1.data.topics[0] == "0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972"` result, err = eventTrigger.Evaluate(event, program) if result { t.Errorf("expect expression to be not match, but got match: error: %v", err) From 53dd37d8ea410a7a7a13c57ec3813284adbda18f Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 27 Dec 2024 02:12:39 -0800 Subject: [PATCH 11/19] add test for trigger with contract read func binding --- core/taskengine/trigger/event.go | 1 - core/taskengine/trigger/event_test.go | 36 ++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/core/taskengine/trigger/event.go b/core/taskengine/trigger/event.go index e43df7a7..3a116b3e 100644 --- a/core/taskengine/trigger/event.go +++ b/core/taskengine/trigger/event.go @@ -167,7 +167,6 @@ func (evt *EventTrigger) Evaluate(event *types.Log, program string) (bool, error jsvm.Set(k, v) } - //result, err := expr.Run(program, envs) result, err := jsvm.RunString(program) if err != nil { diff --git a/core/taskengine/trigger/event_test.go b/core/taskengine/trigger/event_test.go index a225bb7e..14a7682c 100644 --- a/core/taskengine/trigger/event_test.go +++ b/core/taskengine/trigger/event_test.go @@ -3,10 +3,11 @@ package trigger import ( "testing" + "github.com/AvaProtocol/ap-avs/core/taskengine/macros" "github.com/AvaProtocol/ap-avs/core/testutil" ) -func TestChainlinkLatestAnswer(t *testing.T) { +func TestTriggerExpression(t *testing.T) { event, err := testutil.GetEventForTx("0x8f7c1f698f03d6d32c996b679ea1ebad45bbcdd9aa95d250dda74763cc0f508d", 82) if err != nil { @@ -39,3 +40,36 @@ func TestChainlinkLatestAnswer(t *testing.T) { t.Errorf("expect expression to be not match, but got match: error: %v", err) } } + +func TestTriggerWithContractReadBindingInExpression(t *testing.T) { + // This event is transfering usdc + event, err := testutil.GetEventForTx("0x4bb728dfbe58d7c641c02a214cac6156a0d6a0fe648cb27a7de229a3160e91b1", 145) + + macros.SetRpc(testutil.GetTestRPCURL()) + eventTrigger := NewEventTrigger(&RpcOption{ + RpcURL: testutil.GetTestRPCURL(), + WsRpcURL: testutil.GetTestRPCURL(), + }, make(chan TriggerMetadata[EventMark], 1000)) + + // USDC pair from chainlink, usually USDC price is ~99cent but never approach $1 + // for an unknow reason the decimal is 8 instead of 6 + program := `trigger1.data.topics[0] == "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" && bigGt(chainlinkPrice("0xA2F78ab2355fe2f984D808B5CeE7FD0A93D5270E"), toBigInt("1000000000"))` + + result, err := eventTrigger.Evaluate(event, program) + if err != nil { + t.Errorf("expected no error when evaluate program but got error: %s", err) + } + if result { + t.Errorf("expect expression to be false, but got true: error: %v", err) + } + + program = `trigger1.data.topics[0] == "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" && bigGt(chainlinkPrice("0xA2F78ab2355fe2f984D808B5CeE7FD0A93D5270E"), toBigInt("95000000"))` + + result, err = eventTrigger.Evaluate(event, program) + if err != nil { + t.Errorf("expected no error when evaluate program but got error: %s", err) + } + if !result { + t.Errorf("expect expression to be false, but got true: error: %v", err) + } +} From 0a2ab8a36143756d266de45a6b40320a545b6ebd Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 27 Dec 2024 03:36:24 -0800 Subject: [PATCH 12/19] implement javascript runner with goja --- core/taskengine/engine.go | 9 ++ core/taskengine/macros/exp.go | 30 +++++++ core/taskengine/vm.go | 84 ++++++++++------- .../vm_runner_contract_read_test.go | 51 +++++++++-- core/taskengine/vm_runner_customcode.go | 86 ++++++++++++++++++ core/taskengine/vm_runner_customcode_test.go | 89 +++++++++++++++++++ .../vm_runner_graphql_query_test.go | 23 ++++- core/taskengine/vm_runner_rest_test.go | 25 +++++- core/taskengine/vm_test.go | 5 ++ 9 files changed, 360 insertions(+), 42 deletions(-) create mode 100644 core/taskengine/vm_runner_customcode.go create mode 100644 core/taskengine/vm_runner_customcode_test.go diff --git a/core/taskengine/engine.go b/core/taskengine/engine.go index 2b1bf010..8ec840ee 100644 --- a/core/taskengine/engine.go +++ b/core/taskengine/engine.go @@ -340,6 +340,10 @@ func (n *Engine) StreamCheckToOperator(payload *avsproto.SyncMessagesReq, srv av continue } + if !n.CanStreamCheck(address) { + continue + } + for _, task := range n.tasks { if _, ok := n.trackSyncedTasks[address].TaskID[task.Id]; ok { continue @@ -797,3 +801,8 @@ func (n *Engine) NewSeqID() (string, error) { } return strconv.FormatInt(int64(num), 10), nil } + +func (n *Engine) CanStreamCheck(address string) bool { + // Only enable for our own operator first, once it's stable we will roll out to all + return address == "0x997e5d40a32c44a3d93e59fc55c4fd20b7d2d49d" || address == "0xc6b87cc9e85b07365b6abefff061f237f7cf7dc3" +} diff --git a/core/taskengine/macros/exp.go b/core/taskengine/macros/exp.go index 55e32ea2..a367ed78 100644 --- a/core/taskengine/macros/exp.go +++ b/core/taskengine/macros/exp.go @@ -19,6 +19,9 @@ var ( rpcConn *ethclient.Client ) +type Builtin struct { +} + func SetRpc(rpcURL string) { if conn, err := ethclient.Dial(rpcURL); err == nil { rpcConn = conn @@ -125,6 +128,33 @@ func ToBigInt(val string) *big.Int { return b } +func (bi *Builtin) ToBigInt(val string) *big.Int { + return ToBigInt(val) +} + +func (bi *Builtin) ChainlinkLatestRoundData(tokenPair string) *big.Int { + return chainlinkLatestRoundData(tokenPair) +} +func (bi *Builtin) ChainlinkLatestAnswer(tokenPair string) *big.Int { + return chainlinkLatestAnswer(tokenPair) +} + +func (bi *Builtin) BigCmp(a *big.Int, b *big.Int) (r int) { + return BigCmp(a, b) +} + +func (bi *Builtin) BigGt(a *big.Int, b *big.Int) bool { + return BigGt(a, b) +} + +func (bi *Builtin) BigLt(a *big.Int, b *big.Int) bool { + return BigLt(a, b) +} + +func (bi *Builtin) ParseUnit(val string, decimal uint) *big.Int { + return ParseUnit(val, decimal) +} + var ( exprEnv = map[string]any{ "readContractData": readContractData, diff --git a/core/taskengine/vm.go b/core/taskengine/vm.go index 539a0a94..cb1c07dd 100644 --- a/core/taskengine/vm.go +++ b/core/taskengine/vm.go @@ -278,37 +278,7 @@ func (v *VM) executeNode(node *avsproto.TaskNode) (*avsproto.Execution_Step, err } if nodeValue := node.GetRestApi(); nodeValue != nil { - // TODO: refactor into function - p := NewRestProrcessor(v) - - // only evaluate string when there is string interpolation - if nodeValue.Body != "" && (strings.Contains(nodeValue.Body, "$") || strings.Contains(nodeValue.Body, "`")) { - nodeValue2 := &avsproto.RestAPINode{ - Url: macros.RenderString(nodeValue.Url, macroEnvs), - Headers: nodeValue.Headers, - Method: nodeValue.Method, - Body: strings.Clone(nodeValue.Body), - } - jsvm := goja.New() - - for key, value := range v.vars { - jsvm.Set(key, map[string]any{ - "data": value, - }) - } - - renderBody, err := jsvm.RunString(nodeValue.Body) - if err == nil { - nodeValue2.Body = renderBody.Export().(string) - } else { - fmt.Println("error render string with goja", err) - } - executionLog, err = p.Execute(node.Id, nodeValue2) - } else { - executionLog, err = p.Execute(node.Id, nodeValue) - } - - v.ExecutionLogs = append(v.ExecutionLogs, executionLog) + executionLog, err = v.runRestApi(node.Id, nodeValue) } else if nodeValue := node.GetBranch(); nodeValue != nil { outcomeID := "" executionLog, outcomeID, err = v.runBranch(node.Id, nodeValue) @@ -331,8 +301,49 @@ func (v *VM) executeNode(node *avsproto.TaskNode) (*avsproto.Execution_Step, err } } else if nodeValue := node.GetGraphqlQuery(); nodeValue != nil { executionLog, err = v.runGraphQL(node.Id, nodeValue) + } else if nodeValue := node.GetCustomCode(); nodeValue != nil { + executionLog, err = v.runCustomCode(node.Id, nodeValue) + } + + return executionLog, err +} + +func (v *VM) runRestApi(stepID string, nodeValue *avsproto.RestAPINode) (*avsproto.Execution_Step, error) { + p := NewRestProrcessor(v) + + var err error + executionLog := &avsproto.Execution_Step{ + NodeId: stepID, + } + + // only evaluate string when there is string interpolation + if nodeValue.Body != "" && (strings.Contains(nodeValue.Body, "$") || strings.Contains(nodeValue.Body, "`")) { + nodeValue2 := &avsproto.RestAPINode{ + Url: macros.RenderString(nodeValue.Url, macroEnvs), + Headers: nodeValue.Headers, + Method: nodeValue.Method, + Body: strings.Clone(nodeValue.Body), + } + jsvm := goja.New() + + for key, value := range v.vars { + jsvm.Set(key, map[string]any{ + "data": value, + }) + } + + renderBody, err := jsvm.RunString(nodeValue.Body) + if err == nil { + nodeValue2.Body = renderBody.Export().(string) + } else { + v.logger.Error("error render string with goja", "error", err) + } + executionLog, err = p.Execute(stepID, nodeValue2) + } else { + executionLog, err = p.Execute(stepID, nodeValue) } + v.ExecutionLogs = append(v.ExecutionLogs, executionLog) return executionLog, err } @@ -350,6 +361,17 @@ func (v *VM) runGraphQL(stepID string, node *avsproto.GraphQLQueryNode) (*avspro return executionLog, nil } +func (v *VM) runCustomCode(stepID string, node *avsproto.CustomCodeNode) (*avsproto.Execution_Step, error) { + r := NewJSProcessor(v) + executionLog, err := r.Execute(stepID, node) + if err != nil { + v.logger.Error("error execute JavaScript code", "task_id", v.TaskID, "step", stepID, "error", err) + } + v.ExecutionLogs = append(v.ExecutionLogs, executionLog) + + return executionLog, nil +} + func (v *VM) runBranch(stepID string, node *avsproto.BranchNode) (*avsproto.Execution_Step, string, error) { t0 := time.Now() s := &avsproto.Execution_Step{ diff --git a/core/taskengine/vm_runner_contract_read_test.go b/core/taskengine/vm_runner_contract_read_test.go index 1a989cad..d57ce634 100644 --- a/core/taskengine/vm_runner_contract_read_test.go +++ b/core/taskengine/vm_runner_contract_read_test.go @@ -10,15 +10,35 @@ import ( ) func TestContractReadSimpleReturn(t *testing.T) { - n := NewContractReadProcessor(testutil.GetRpcClient()) - node := &avsproto.ContractReadNode{ ContractAddress: "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238", CallData: "0x70a08231000000000000000000000000ce289bb9fb0a9591317981223cbe33d5dc42268d", ContractAbi: `[{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]`, Method: "balanceOf", } - step, err := n.Execute("check balance", node) + nodes := []*avsproto.TaskNode{ + &avsproto.TaskNode{ + Id: "123", + Name: "contractQuery", + TaskType: &avsproto.TaskNode_ContractRead{ + ContractRead: node, + }, + }, + } + + edges := []*avsproto.TaskEdge{ + &avsproto.TaskEdge{ + Id: "e1", + Source: "__TRIGGER__", + Target: "123", + }, + } + + vm, err := NewVMWithData("123", nil, nodes, edges) + + n := NewContractReadProcessor(vm, testutil.GetRpcClient()) + + step, err := n.Execute("123", node) if err != nil { t.Errorf("expected contract read node run succesfull but got error: %v", err) @@ -41,15 +61,34 @@ func TestContractReadSimpleReturn(t *testing.T) { } func TestContractReadComplexReturn(t *testing.T) { - n := NewContractReadProcessor(testutil.GetRpcClient()) - node := &avsproto.ContractReadNode{ ContractAddress: "0xc59E3633BAAC79493d908e63626716e204A45EdF", CallData: "0x9a6fc8f500000000000000000000000000000000000000000000000100000000000052e7", ContractAbi: `[{"inputs":[{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"}]`, Method: "getRoundData", } - step, err := n.Execute("latest round data", node) + + nodes := []*avsproto.TaskNode{ + &avsproto.TaskNode{ + Id: "123abc", + Name: "contractQuery", + TaskType: &avsproto.TaskNode_ContractRead{ + ContractRead: node, + }, + }, + } + + edges := []*avsproto.TaskEdge{ + &avsproto.TaskEdge{ + Id: "e1", + Source: "__TRIGGER__", + Target: "123abc", + }, + } + + vm, err := NewVMWithData("123abc", nil, nodes, edges) + n := NewContractReadProcessor(vm, testutil.GetRpcClient()) + step, err := n.Execute("123abc", node) if err != nil { t.Errorf("expected contract read node run succesfull but got error: %v", err) diff --git a/core/taskengine/vm_runner_customcode.go b/core/taskengine/vm_runner_customcode.go new file mode 100644 index 00000000..7adb547a --- /dev/null +++ b/core/taskengine/vm_runner_customcode.go @@ -0,0 +1,86 @@ +package taskengine + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "github.com/dop251/goja" + + "github.com/AvaProtocol/ap-avs/core/taskengine/macros" + avsproto "github.com/AvaProtocol/ap-avs/protobuf" +) + +type JSProcessor struct { + *CommonProcessor + jsvm *goja.Runtime +} + +func NewJSProcessor(vm *VM) *JSProcessor { + r := JSProcessor{ + CommonProcessor: &CommonProcessor{ + vm: vm, + }, + jsvm: goja.New(), + } + + for key, value := range macros.GetEnvs(nil) { + r.jsvm.Set(key, value) + } + for key, value := range vm.vars { + r.jsvm.Set(key, map[string]any{ + "data": value, + }) + } + + return &r +} + +func (r *JSProcessor) Execute(stepID string, node *avsproto.CustomCodeNode) (*avsproto.Execution_Step, error) { + t0 := time.Now().Unix() + + s := &avsproto.Execution_Step{ + NodeId: stepID, + Log: "", + OutputData: "", + Success: true, + Error: "", + StartAt: t0, + } + + var err error + defer func() { + s.EndAt = time.Now().Unix() + s.Success = err == nil + if err != nil { + s.Error = err.Error() + } + }() + + var log strings.Builder + + log.WriteString(fmt.Sprintf("Start execute user-input JS code at %s", time.Now())) + //result, err := r.jsvm.RunString("(function() {" + node.Source + "})()") + result, err := r.jsvm.RunString(node.Source) + log.WriteString(fmt.Sprintf("Complete Execute user-input JS code at %s", time.Now())) + if err != nil { + s.Success = false + s.Error = err.Error() + log.WriteString("\nerror running JavaScript code:") + log.WriteString(err.Error()) + } + s.Log = log.String() + + resultValue := result.Export() + // TODO: capsize + if outputData, serilizeError := json.Marshal(resultValue); serilizeError == nil { + s.OutputData = string(outputData) + } else { + log.WriteString("cannot serilize output data to log") + } + + r.SetOutputVarForStep(stepID, resultValue) + + return s, err +} diff --git a/core/taskengine/vm_runner_customcode_test.go b/core/taskengine/vm_runner_customcode_test.go new file mode 100644 index 00000000..fb854782 --- /dev/null +++ b/core/taskengine/vm_runner_customcode_test.go @@ -0,0 +1,89 @@ +package taskengine + +import ( + "strings" + "testing" + + avsproto "github.com/AvaProtocol/ap-avs/protobuf" +) + +func TestRunJavaScript(t *testing.T) { + node := &avsproto.CustomCodeNode{ + Source: "3>2", + } + nodes := []*avsproto.TaskNode{ + &avsproto.TaskNode{ + Id: "123abc", + Name: "customJs", + TaskType: &avsproto.TaskNode_CustomCode{ + CustomCode: node, + }, + }, + } + + edges := []*avsproto.TaskEdge{ + &avsproto.TaskEdge{ + Id: "e1", + Source: "__TRIGGER__", + Target: "123abc", + }, + } + + vm, err := NewVMWithData("123abc", nil, nodes, edges) + n := NewJSProcessor(vm) + + step, err := n.Execute("123abc", node) + + if err != nil { + t.Errorf("expected JavaScript node run succesfull but got error: %v", err) + } + + if !step.Success { + t.Errorf("expected JavaScript node run succesfully but failed") + } + + if !strings.Contains(step.Log, "Start execute user-input JS code at") { + t.Errorf("expected log contains trace data but found no") + } + + if step.Error != "" { + t.Errorf("expected log contains request trace data but found no") + } + + if step.OutputData != "true" { + t.Errorf("wrong result, expect true got %s", step.OutputData) + } + +} + +func TestRunJavaScriptComplex(t *testing.T) { + node := &avsproto.CustomCodeNode{ + Source: "const a=[1,2,3]; a.filter((i) => i >= 2);", + } + nodes := []*avsproto.TaskNode{ + &avsproto.TaskNode{ + Id: "123abc", + Name: "customJs", + TaskType: &avsproto.TaskNode_CustomCode{ + CustomCode: node, + }, + }, + } + + edges := []*avsproto.TaskEdge{ + &avsproto.TaskEdge{ + Id: "e1", + Source: "__TRIGGER__", + Target: "123abc", + }, + } + + vm, _ := NewVMWithData("123abc", nil, nodes, edges) + n := NewJSProcessor(vm) + + step, _ := n.Execute("123abc", node) + + if step.OutputData != "[2,3]" { + t.Errorf("wrong JS code evaluation result, expect [2,3] got %s", step.OutputData) + } +} diff --git a/core/taskengine/vm_runner_graphql_query_test.go b/core/taskengine/vm_runner_graphql_query_test.go index 57d979a4..cb87d9f4 100644 --- a/core/taskengine/vm_runner_graphql_query_test.go +++ b/core/taskengine/vm_runner_graphql_query_test.go @@ -22,9 +22,28 @@ func TestGraphlQlNodeSimpleQuery(t *testing.T) { }`, } - n, _ := NewGraphqlQueryProcessor(node.Url) + nodes := []*avsproto.TaskNode{ + &avsproto.TaskNode{ + Id: "123abc", + Name: "graphqlQuery", + TaskType: &avsproto.TaskNode_GraphqlQuery{ + GraphqlQuery: node, + }, + }, + } + + edges := []*avsproto.TaskEdge{ + &avsproto.TaskEdge{ + Id: "e1", + Source: "__TRIGGER__", + Target: "123abc", + }, + } + + vm, err := NewVMWithData("123abc", nil, nodes, edges) + n, _ := NewGraphqlQueryProcessor(vm, node.Url) - step, err := n.Execute("lido approval", node) + step, _, err := n.Execute("123abc", node) if err != nil { t.Errorf("expected rest node run succesfull but got error: %v", err) diff --git a/core/taskengine/vm_runner_rest_test.go b/core/taskengine/vm_runner_rest_test.go index af4ff971..1b3f938e 100644 --- a/core/taskengine/vm_runner_rest_test.go +++ b/core/taskengine/vm_runner_rest_test.go @@ -8,8 +8,6 @@ import ( ) func TestRestRequest(t *testing.T) { - n := NewRestProrcessor() - node := &avsproto.RestAPINode{ Url: "https://httpbin.org/post", Headers: map[string]string{ @@ -18,7 +16,28 @@ func TestRestRequest(t *testing.T) { Body: "chat_id=123&disable_notification=true&text=%2AThis+is+a+test+format%2A", Method: "POST", } - step, err := n.Execute("foo123", node) + + nodes := []*avsproto.TaskNode{ + &avsproto.TaskNode{ + Id: "123abc", + Name: "restApi", + TaskType: &avsproto.TaskNode_RestApi{ + RestApi: node, + }, + }, + } + + edges := []*avsproto.TaskEdge{ + &avsproto.TaskEdge{ + Id: "e1", + Source: "__TRIGGER__", + Target: "123abc", + }, + } + + vm, err := NewVMWithData("123abc", nil, nodes, edges) + n := NewRestProrcessor(vm) + step, err := n.Execute("123abc", node) if err != nil { t.Errorf("expected rest node run succesfull but got error: %v", err) diff --git a/core/taskengine/vm_test.go b/core/taskengine/vm_test.go index 66aace63..cdaaf9e6 100644 --- a/core/taskengine/vm_test.go +++ b/core/taskengine/vm_test.go @@ -90,6 +90,11 @@ func TestRunSimpleTasks(t *testing.T) { if !strings.Contains(vm.ExecutionLogs[0].Log, "Execute") { t.Errorf("error generating log for executing. expect a log line displaying the request attempt, got nothing") } + + data := vm.vars["httpnode"].(map[string]any) + if data["data"].(string) != "a=123" { + t.Errorf("step result isn't store properly, expect 123 got %s", data["data"]) + } } func TestRunSequentialTasks(t *testing.T) { From d995c9ade108da6db1e20c16c8739f304abe7e84 Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 27 Dec 2024 11:31:18 -0800 Subject: [PATCH 13/19] adding more test for js runner --- core/taskengine/macros/exp.go | 65 ++++++++++++++++++++ core/taskengine/vm_runner_customcode.go | 18 +++--- core/taskengine/vm_runner_customcode_test.go | 36 +++++++++++ 3 files changed, 111 insertions(+), 8 deletions(-) diff --git a/core/taskengine/macros/exp.go b/core/taskengine/macros/exp.go index a367ed78..17c0d2df 100644 --- a/core/taskengine/macros/exp.go +++ b/core/taskengine/macros/exp.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" ethmath "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/ethclient" + "github.com/go-resty/resty/v2" "github.com/expr-lang/expr" "github.com/expr-lang/expr/vm" @@ -157,6 +158,8 @@ func (bi *Builtin) ParseUnit(val string, decimal uint) *big.Int { var ( exprEnv = map[string]any{ + "fetch": Fetch, + "request": Fetch, "readContractData": readContractData, "priceChainlink": chainlinkLatestAnswer, @@ -171,6 +174,68 @@ var ( } ) +// FetchResponse mimics the JS fetch Response object +type FetchResponse struct { + Status int + StatusText string + Body string + Headers map[string][]string +} + +// FetchOptions allows specifying method, headers, and body +type FetchOptions struct { + Method string + Headers map[string]string + Body interface{} +} + +// Fetch mimics the JS fetch function using Resty +func Fetch(url string) *FetchResponse { + options := FetchOptions{} + + fmt.Println("FETCH", url) + client := resty.New() + // Create request + request := client.R() + + // Set headers + if options.Headers != nil { + request.SetHeaders(options.Headers) + } + + // Set body + if options.Body != nil { + request.SetBody(options.Body) + } + + // Send request based on method + var resp *resty.Response + var err error + switch options.Method { + case "POST": + resp, err = request.Post(url) + case "PUT": + resp, err = request.Put(url) + case "DELETE": + resp, err = request.Delete(url) + default: + resp, err = request.Get(url) // Default to GET + } + + // Handle errors + if err != nil { + return nil + } + + // Build FetchResponse + return &FetchResponse{ + Status: resp.StatusCode(), + StatusText: resp.Status(), + Body: string(resp.Body()), + Headers: resp.Header(), + } +} + func GetEnvs(extra map[string]any) map[string]interface{} { envs := map[string]any{} diff --git a/core/taskengine/vm_runner_customcode.go b/core/taskengine/vm_runner_customcode.go index 7adb547a..81d3a1f5 100644 --- a/core/taskengine/vm_runner_customcode.go +++ b/core/taskengine/vm_runner_customcode.go @@ -26,6 +26,7 @@ func NewJSProcessor(vm *VM) *JSProcessor { } for key, value := range macros.GetEnvs(nil) { + fmt.Println("Set", key) r.jsvm.Set(key, value) } for key, value := range vm.vars { @@ -72,15 +73,16 @@ func (r *JSProcessor) Execute(stepID string, node *avsproto.CustomCodeNode) (*av } s.Log = log.String() - resultValue := result.Export() - // TODO: capsize - if outputData, serilizeError := json.Marshal(resultValue); serilizeError == nil { - s.OutputData = string(outputData) - } else { - log.WriteString("cannot serilize output data to log") + if result != nil { + resultValue := result.Export() + // TODO: capsize + if outputData, serilizeError := json.Marshal(resultValue); serilizeError == nil { + s.OutputData = string(outputData) + } else { + log.WriteString("cannot serilize output data to log") + } + r.SetOutputVarForStep(stepID, resultValue) } - r.SetOutputVarForStep(stepID, resultValue) - return s, err } diff --git a/core/taskengine/vm_runner_customcode_test.go b/core/taskengine/vm_runner_customcode_test.go index fb854782..4d1c1331 100644 --- a/core/taskengine/vm_runner_customcode_test.go +++ b/core/taskengine/vm_runner_customcode_test.go @@ -1,6 +1,7 @@ package taskengine import ( + "fmt" "strings" "testing" @@ -87,3 +88,38 @@ func TestRunJavaScriptComplex(t *testing.T) { t.Errorf("wrong JS code evaluation result, expect [2,3] got %s", step.OutputData) } } + +func TestRunJavaScriptHTTP(t *testing.T) { + node := &avsproto.CustomCodeNode{ + Source: ` + toBigInt("1234442") + `, + } + nodes := []*avsproto.TaskNode{ + &avsproto.TaskNode{ + Id: "123abc", + Name: "customJs", + TaskType: &avsproto.TaskNode_CustomCode{ + CustomCode: node, + }, + }, + } + + edges := []*avsproto.TaskEdge{ + &avsproto.TaskEdge{ + Id: "e1", + Source: "__TRIGGER__", + Target: "123abc", + }, + } + + vm, _ := NewVMWithData("123abc", nil, nodes, edges) + n := NewJSProcessor(vm) + + step, err := n.Execute("123abc", node) + fmt.Println("error", err, step.OutputData) + + if step.OutputData != "[2,3]" { + t.Errorf("wrong JS code evaluation result, expect [2,3] got %s", step.OutputData) + } +} From b31ab793175c757e7b85bb5faf0bada7152a9e71 Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 27 Dec 2024 11:31:54 -0800 Subject: [PATCH 14/19] temp workaround to disable slashing on testnet --- aggregator/aggregator.go | 7 ++++--- operator/operator.go | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index 9468b547..336fce3b 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -107,7 +107,8 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { avsWriter, err := chainio.BuildAvsWriterFromConfig(c) if err != nil { c.Logger.Errorf("Cannot create avsWriter", "err", err) - return nil, err + // EigenLayer has update the contract and we cannot fetch the slasher anymore, we should upgrade the EigenSDK, right now we don't use it so it's ok to ignore this error + //return nil, err } go func() { @@ -122,8 +123,8 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { clients, err := clients.BuildAll(chainioConfig, c.EcdsaPrivateKey, c.Logger) if err != nil { c.Logger.Errorf("Cannot create sdk clients", "err", err) - panic(err) - //return nil, err + // EigenLayer has update the contract and we cannot fetch the slasher anymore, we should upgrade the EigenSDK, right now we don't use it so it's ok to ignore this error + //panic(err) } c.Logger.Info("create avsrrader and client", "avsReader", avsReader, "clients", clients) }() diff --git a/operator/operator.go b/operator/operator.go index aa8721e7..8c6884b5 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -283,7 +283,7 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { } sdkClients, err := clients.BuildAll(chainioConfig, operatorEcdsaPrivateKey, logger) if err != nil { - panic(err) + //panic(err) } skWallet, err := wallet.NewPrivateKeyWallet(ethRpcClient, signerV2, signerAddress, logger) if err != nil { @@ -297,7 +297,8 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { ) if err != nil { logger.Error("Cannot create AvsWriter", "err", err) - return nil, err + // EigenLayer has update the contract and we cannot fetch the slasher anymore, we should upgrade the EigenSDK, right now we don't use it so it's ok to ignore this error + //return nil, err } avsReader, err := chainio.BuildAvsReader( @@ -306,7 +307,8 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { ethRpcClient, logger) if err != nil { logger.Error("Cannot create AvsReader", "err", err) - return nil, err + // EigenLayer has update the contract and we cannot fetch the slasher anymore, we should upgrade the EigenSDK, right now we don't use it so it's ok to ignore this error + //return nil, err } // avsSubscriber, err := chainio.BuildAvsSubscriber(common.HexToAddress(c.AVSRegistryCoordinatorAddress), // common.HexToAddress(c.OperatorStateRetrieverAddress), ethWsClient, logger, From ed4aa3e3cd90cb1ad8deb9f958d452dd8916d454 Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 27 Dec 2024 12:14:29 -0800 Subject: [PATCH 15/19] disable wip test --- core/taskengine/macros/exp.go | 7 +- core/taskengine/vm_runner_customcode.go | 3 +- core/taskengine/vm_runner_customcode_test.go | 70 ++++++++++---------- 3 files changed, 41 insertions(+), 39 deletions(-) diff --git a/core/taskengine/macros/exp.go b/core/taskengine/macros/exp.go index 17c0d2df..aacfbf28 100644 --- a/core/taskengine/macros/exp.go +++ b/core/taskengine/macros/exp.go @@ -158,8 +158,10 @@ func (bi *Builtin) ParseUnit(val string, decimal uint) *big.Int { var ( exprEnv = map[string]any{ - "fetch": Fetch, - "request": Fetch, + // bind and simular JS fetch api + "fetch": Fetch, + + // macro to do IO from JS "readContractData": readContractData, "priceChainlink": chainlinkLatestAnswer, @@ -193,7 +195,6 @@ type FetchOptions struct { func Fetch(url string) *FetchResponse { options := FetchOptions{} - fmt.Println("FETCH", url) client := resty.New() // Create request request := client.R() diff --git a/core/taskengine/vm_runner_customcode.go b/core/taskengine/vm_runner_customcode.go index 81d3a1f5..6f4ffa18 100644 --- a/core/taskengine/vm_runner_customcode.go +++ b/core/taskengine/vm_runner_customcode.go @@ -25,10 +25,11 @@ func NewJSProcessor(vm *VM) *JSProcessor { jsvm: goja.New(), } + // These are built-in func for key, value := range macros.GetEnvs(nil) { - fmt.Println("Set", key) r.jsvm.Set(key, value) } + /// Binding the data from previous step into jsvm for key, value := range vm.vars { r.jsvm.Set(key, map[string]any{ "data": value, diff --git a/core/taskengine/vm_runner_customcode_test.go b/core/taskengine/vm_runner_customcode_test.go index 4d1c1331..a6b3e737 100644 --- a/core/taskengine/vm_runner_customcode_test.go +++ b/core/taskengine/vm_runner_customcode_test.go @@ -1,7 +1,6 @@ package taskengine import ( - "fmt" "strings" "testing" @@ -89,37 +88,38 @@ func TestRunJavaScriptComplex(t *testing.T) { } } -func TestRunJavaScriptHTTP(t *testing.T) { - node := &avsproto.CustomCodeNode{ - Source: ` - toBigInt("1234442") - `, - } - nodes := []*avsproto.TaskNode{ - &avsproto.TaskNode{ - Id: "123abc", - Name: "customJs", - TaskType: &avsproto.TaskNode_CustomCode{ - CustomCode: node, - }, - }, - } - - edges := []*avsproto.TaskEdge{ - &avsproto.TaskEdge{ - Id: "e1", - Source: "__TRIGGER__", - Target: "123abc", - }, - } - - vm, _ := NewVMWithData("123abc", nil, nodes, edges) - n := NewJSProcessor(vm) - - step, err := n.Execute("123abc", node) - fmt.Println("error", err, step.OutputData) - - if step.OutputData != "[2,3]" { - t.Errorf("wrong JS code evaluation result, expect [2,3] got %s", step.OutputData) - } -} +// Temp disable until we figured out the event loop +// func TestRunJavaScriptHTTP(t *testing.T) { +// node := &avsproto.CustomCodeNode{ +// Source: ` +// toBigInt("1234442") +// `, +// } +// nodes := []*avsproto.TaskNode{ +// &avsproto.TaskNode{ +// Id: "123abc", +// Name: "customJs", +// TaskType: &avsproto.TaskNode_CustomCode{ +// CustomCode: node, +// }, +// }, +// } +// +// edges := []*avsproto.TaskEdge{ +// &avsproto.TaskEdge{ +// Id: "e1", +// Source: "__TRIGGER__", +// Target: "123abc", +// }, +// } +// +// vm, _ := NewVMWithData("123abc", nil, nodes, edges) +// n := NewJSProcessor(vm) +// +// step, err := n.Execute("123abc", node) +// fmt.Println("error", err, step.OutputData) +// +// if step.OutputData != "[2,3]" { +// t.Errorf("wrong JS code evaluation result, expect [2,3] got %s", step.OutputData) +// } +// } From ef7bf2cff831440953e0e6c64fa068902c2b48cb Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 27 Dec 2024 12:20:09 -0800 Subject: [PATCH 16/19] standarize name --- core/taskengine/vm.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/taskengine/vm.go b/core/taskengine/vm.go index cb1c07dd..ae59c448 100644 --- a/core/taskengine/vm.go +++ b/core/taskengine/vm.go @@ -3,6 +3,7 @@ package taskengine import ( "context" "fmt" + "regexp" "strings" "sync" "time" @@ -98,8 +99,20 @@ func (v *VM) WithLogger(logger sdklogging.Logger) *VM { } func (v *VM) GetNodeNameAsVar(nodeID string) string { + // Replace invalid characters with _ + re := regexp.MustCompile(`[^a-zA-Z0-9_$]`) name := v.TaskNodes[nodeID].Name - return name + if name == "" { + name = nodeID + } + standardized := re.ReplaceAllString(v.TaskNodes[nodeID].Name, "_") + + // Ensure the first character is valid + if len(standardized) == 0 || !regexp.MustCompile(`^[a-zA-Z_$]`).MatchString(standardized[:1]) { + standardized = "_" + standardized + } + + return standardized } func NewVMWithData(taskID string, triggerMetadata *avsproto.TriggerMetadata, nodes []*avsproto.TaskNode, edges []*avsproto.TaskEdge) (*VM, error) { From b02c2128b945679eafc4414bdbb5b2a272cccf86 Mon Sep 17 00:00:00 2001 From: Vinh Date: Mon, 30 Dec 2024 04:58:14 -0800 Subject: [PATCH 17/19] cleanup --- core/taskengine/engine.go | 1 - core/taskengine/vm_runner_contract_write.go | 96 +++++++++++++++++++++ core/taskengine/vm_runner_graphql_query.go | 1 - 3 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 core/taskengine/vm_runner_contract_write.go diff --git a/core/taskengine/engine.go b/core/taskengine/engine.go index aa5bf779..8ec840ee 100644 --- a/core/taskengine/engine.go +++ b/core/taskengine/engine.go @@ -567,7 +567,6 @@ func (n *Engine) TriggerTask(user *model.User, payload *avsproto.UserTriggerTask if payload.IsBlocking { // Run the task inline, by pass the queue system executor := NewExecutor(n.db, n.logger) - fmt.Println("metadata", payload.TriggerMetadata) execution, err := executor.RunTask(task, payload.TriggerMetadata) if err == nil { return &avsproto.UserTriggerTaskResp{ diff --git a/core/taskengine/vm_runner_contract_write.go b/core/taskengine/vm_runner_contract_write.go new file mode 100644 index 00000000..efb78901 --- /dev/null +++ b/core/taskengine/vm_runner_contract_write.go @@ -0,0 +1,96 @@ +package taskengine + +import ( + "context" + "encoding/json" + "fmt" + "strings" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + + avsproto "github.com/AvaProtocol/ap-avs/protobuf" +) + +type ContractWriteProcessor struct { + *CommonProcessor + client *ethclient.Client +} + +func NewContractWriteProcessor(vm *VM, client *ethclient.Client) *ContractWriteProcessor { + return &ContractWriteProcessor{ + client: client, + CommonProcessor: &CommonProcessor{ + vm: vm, + }, + } +} + +func (r *ContractWriteProcessor) Execute(stepID string, node *avsproto.ContractWriteNode) (*avsproto.Execution_Step, error) { + ctx := context.Background() + t0 := time.Now().Unix() + s := &avsproto.Execution_Step{ + NodeId: stepID, + Log: "", + OutputData: "", + Success: true, + Error: "", + StartAt: t0, + } + + var err error + defer func() { + s.EndAt = time.Now().Unix() + s.Success = err == nil + if err != nil { + s.Error = err.Error() + } + }() + + var log strings.Builder + + // TODO: support load pre-define ABI + parsedABI, err := abi.JSON(strings.NewReader(node.ContractAbi)) + if err != nil { + return nil, fmt.Errorf("error parse abi: %w", err) + } + + contractAddress := common.HexToAddress(node.ContractAddress) + calldata := common.FromHex(node.CallData) + msg := ethereum.CallMsg{ + To: &contractAddress, + Data: calldata, + } + + output, err := r.client.CallContract(ctx, msg, nil) + + if err != nil { + s.Success = false + s.Error = fmt.Errorf("error invoke contract method: %w", err).Error() + return s, err + } + + // Unpack the output + result, err := parsedABI.Unpack(node.Method, output) + if err != nil { + s.Success = false + s.Error = fmt.Errorf("error decode result: %w", err).Error() + return s, err + } + + log.WriteString(fmt.Sprintf("Call %s on %s at %s", node.Method, node.ContractAddress, time.Now())) + s.Log = log.String() + outputData, err := json.Marshal(result) + s.OutputData = string(outputData) + r.SetOutputVarForStep(stepID, outputData) + if err != nil { + s.Success = false + s.Error = err.Error() + return s, err + } + + return s, nil +} diff --git a/core/taskengine/vm_runner_graphql_query.go b/core/taskengine/vm_runner_graphql_query.go index 186b88d3..6e073abf 100644 --- a/core/taskengine/vm_runner_graphql_query.go +++ b/core/taskengine/vm_runner_graphql_query.go @@ -23,7 +23,6 @@ type GraphqlQueryProcessor struct { func NewGraphqlQueryProcessor(vm *VM, endpoint string) (*GraphqlQueryProcessor, error) { sb := &strings.Builder{} log := func(s string) { - fmt.Println("LOGLOG", s) sb.WriteString(s) } From 17c354ebab80cac32a2cd1a9bc64972254f8c5ab Mon Sep 17 00:00:00 2001 From: Vinh Date: Mon, 30 Dec 2024 04:59:40 -0800 Subject: [PATCH 18/19] add todo --- aggregator/aggregator.go | 2 ++ operator/operator.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index 336fce3b..505614ba 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -107,6 +107,7 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { avsWriter, err := chainio.BuildAvsWriterFromConfig(c) if err != nil { c.Logger.Errorf("Cannot create avsWriter", "err", err) + // TODO: Upgrade EigenSDK to use the new Slash Manager // EigenLayer has update the contract and we cannot fetch the slasher anymore, we should upgrade the EigenSDK, right now we don't use it so it's ok to ignore this error //return nil, err } @@ -123,6 +124,7 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { clients, err := clients.BuildAll(chainioConfig, c.EcdsaPrivateKey, c.Logger) if err != nil { c.Logger.Errorf("Cannot create sdk clients", "err", err) + // TODO: Upgrade EigenSDK to use the new Slash Manager // EigenLayer has update the contract and we cannot fetch the slasher anymore, we should upgrade the EigenSDK, right now we don't use it so it's ok to ignore this error //panic(err) } diff --git a/operator/operator.go b/operator/operator.go index 8c6884b5..eaefba39 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -297,6 +297,7 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { ) if err != nil { logger.Error("Cannot create AvsWriter", "err", err) + // TODO: Upgrade EigenSDK to use the new Slash Manager // EigenLayer has update the contract and we cannot fetch the slasher anymore, we should upgrade the EigenSDK, right now we don't use it so it's ok to ignore this error //return nil, err } @@ -307,6 +308,7 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { ethRpcClient, logger) if err != nil { logger.Error("Cannot create AvsReader", "err", err) + // TODO: Upgrade EigenSDK to use the new Slash Manager // EigenLayer has update the contract and we cannot fetch the slasher anymore, we should upgrade the EigenSDK, right now we don't use it so it's ok to ignore this error //return nil, err } From 3449d77ad19ff71b61ea159629da6133be57f1f3 Mon Sep 17 00:00:00 2001 From: Vinh Date: Mon, 30 Dec 2024 05:12:56 -0800 Subject: [PATCH 19/19] cleanup --- core/taskengine/vm_runner_contract_write.go | 96 --------------------- 1 file changed, 96 deletions(-) delete mode 100644 core/taskengine/vm_runner_contract_write.go diff --git a/core/taskengine/vm_runner_contract_write.go b/core/taskengine/vm_runner_contract_write.go deleted file mode 100644 index efb78901..00000000 --- a/core/taskengine/vm_runner_contract_write.go +++ /dev/null @@ -1,96 +0,0 @@ -package taskengine - -import ( - "context" - "encoding/json" - "fmt" - "strings" - "time" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient" - - avsproto "github.com/AvaProtocol/ap-avs/protobuf" -) - -type ContractWriteProcessor struct { - *CommonProcessor - client *ethclient.Client -} - -func NewContractWriteProcessor(vm *VM, client *ethclient.Client) *ContractWriteProcessor { - return &ContractWriteProcessor{ - client: client, - CommonProcessor: &CommonProcessor{ - vm: vm, - }, - } -} - -func (r *ContractWriteProcessor) Execute(stepID string, node *avsproto.ContractWriteNode) (*avsproto.Execution_Step, error) { - ctx := context.Background() - t0 := time.Now().Unix() - s := &avsproto.Execution_Step{ - NodeId: stepID, - Log: "", - OutputData: "", - Success: true, - Error: "", - StartAt: t0, - } - - var err error - defer func() { - s.EndAt = time.Now().Unix() - s.Success = err == nil - if err != nil { - s.Error = err.Error() - } - }() - - var log strings.Builder - - // TODO: support load pre-define ABI - parsedABI, err := abi.JSON(strings.NewReader(node.ContractAbi)) - if err != nil { - return nil, fmt.Errorf("error parse abi: %w", err) - } - - contractAddress := common.HexToAddress(node.ContractAddress) - calldata := common.FromHex(node.CallData) - msg := ethereum.CallMsg{ - To: &contractAddress, - Data: calldata, - } - - output, err := r.client.CallContract(ctx, msg, nil) - - if err != nil { - s.Success = false - s.Error = fmt.Errorf("error invoke contract method: %w", err).Error() - return s, err - } - - // Unpack the output - result, err := parsedABI.Unpack(node.Method, output) - if err != nil { - s.Success = false - s.Error = fmt.Errorf("error decode result: %w", err).Error() - return s, err - } - - log.WriteString(fmt.Sprintf("Call %s on %s at %s", node.Method, node.ContractAddress, time.Now())) - s.Log = log.String() - outputData, err := json.Marshal(result) - s.OutputData = string(outputData) - r.SetOutputVarForStep(stepID, outputData) - if err != nil { - s.Success = false - s.Error = err.Error() - return s, err - } - - return s, nil -}