Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 4ad51f8

Browse files
authored
Revert "CCIP-4403 LBTC attestation cherry-pick (#1564)" (#1566)
Revert 281302c 976f457 To unblock potential release
1 parent 281302c commit 4ad51f8

File tree

8 files changed

+66
-885
lines changed

8 files changed

+66
-885
lines changed

core/services/ocr2/delegate.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ func (d *Delegate) ccipExecGetDstProvider(ctx context.Context, jb job.Job, plugi
18941894

18951895
// PROVIDER BASED ARG CONSTRUCTION
18961896
// Write PluginConfig bytes to send source/dest relayer provider + info outside of top level rargs/pargs over the wire
1897-
dstConfigBytes, err := newExecPluginConfig(false, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock, pluginJobSpecConfig.USDCConfig, pluginJobSpecConfig.LBTCConfig, string(jb.ID)).Encode()
1897+
dstConfigBytes, err := newExecPluginConfig(false, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock, pluginJobSpecConfig.USDCConfig, string(jb.ID)).Encode()
18981898
if err != nil {
18991899
return nil, err
19001900
}
@@ -1927,7 +1927,7 @@ func (d *Delegate) ccipExecGetDstProvider(ctx context.Context, jb job.Job, plugi
19271927

19281928
func (d *Delegate) ccipExecGetSrcProvider(ctx context.Context, jb job.Job, pluginJobSpecConfig ccipconfig.ExecPluginJobSpecConfig, transmitterID string, dstProvider types.CCIPExecProvider) (srcProvider types.CCIPExecProvider, srcChainID uint64, err error) {
19291929
spec := jb.OCR2OracleSpec
1930-
srcConfigBytes, err := newExecPluginConfig(true, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock, pluginJobSpecConfig.USDCConfig, pluginJobSpecConfig.LBTCConfig, string(jb.ID)).Encode()
1930+
srcConfigBytes, err := newExecPluginConfig(true, pluginJobSpecConfig.SourceStartBlock, pluginJobSpecConfig.DestStartBlock, pluginJobSpecConfig.USDCConfig, string(jb.ID)).Encode()
19311931
if err != nil {
19321932
return nil, 0, err
19331933
}
@@ -1976,13 +1976,12 @@ func (d *Delegate) ccipExecGetSrcProvider(ctx context.Context, jb job.Job, plugi
19761976
return
19771977
}
19781978

1979-
func newExecPluginConfig(isSourceProvider bool, srcStartBlock uint64, dstStartBlock uint64, usdcConfig ccipconfig.USDCConfig, lbtcConfig ccipconfig.LBTCConfig, jobID string) config.ExecPluginConfig {
1979+
func newExecPluginConfig(isSourceProvider bool, srcStartBlock uint64, dstStartBlock uint64, usdcConfig ccipconfig.USDCConfig, jobID string) config.ExecPluginConfig {
19801980
return config.ExecPluginConfig{
19811981
IsSourceProvider: isSourceProvider,
19821982
SourceStartBlock: srcStartBlock,
19831983
DestStartBlock: dstStartBlock,
19841984
USDCConfig: usdcConfig,
1985-
LBTCConfig: lbtcConfig,
19861985
JobID: jobID,
19871986
}
19881987
}

core/services/ocr2/plugins/ccip/ccipexec/initializers.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,6 @@ func NewExecServices(ctx context.Context, lggr logger.Logger, jb job.Job, srcPro
121121
}
122122
tokenDataProviders[cciptypes.Address(pluginConfig.USDCConfig.SourceTokenAddress.String())] = usdcReader
123123
}
124-
// init lbtc token data provider
125-
if pluginConfig.LBTCConfig.AttestationAPI != "" {
126-
lggr.Infof("LBTC token data provider enabled")
127-
err2 := pluginConfig.LBTCConfig.ValidateLBTCConfig()
128-
if err2 != nil {
129-
return nil, err2
130-
}
131-
132-
lbtcReader, err2 := srcProvider.NewTokenDataReader(ctx, ccip.EvmAddrToGeneric(pluginConfig.LBTCConfig.SourceTokenAddress))
133-
if err2 != nil {
134-
return nil, fmt.Errorf("new lbtc reader: %w", err2)
135-
}
136-
tokenDataProviders[cciptypes.Address(pluginConfig.LBTCConfig.SourceTokenAddress.String())] = lbtcReader
137-
}
138124

139125
// Prom wrappers
140126
onRampReader = observability.NewObservedOnRampReader(onRampReader, srcChainID, ccip.ExecPluginLabel)

core/services/ocr2/plugins/ccip/config/config.go

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ func (c *DynamicPriceGetterConfig) Validate() error {
108108
type ExecPluginJobSpecConfig struct {
109109
SourceStartBlock, DestStartBlock uint64 // Only for first time job add.
110110
USDCConfig USDCConfig
111-
LBTCConfig LBTCConfig
112111
}
113112

114113
type USDCConfig struct {
@@ -120,19 +119,10 @@ type USDCConfig struct {
120119
AttestationAPIIntervalMilliseconds int
121120
}
122121

123-
type LBTCConfig struct {
124-
SourceTokenAddress common.Address
125-
AttestationAPI string
126-
AttestationAPITimeoutSeconds uint
127-
// AttestationAPIIntervalMilliseconds can be set to -1 to disable or 0 to use a default interval.
128-
AttestationAPIIntervalMilliseconds int
129-
}
130-
131122
type ExecPluginConfig struct {
132123
SourceStartBlock, DestStartBlock uint64 // Only for first time job add.
133124
IsSourceProvider bool
134125
USDCConfig USDCConfig
135-
LBTCConfig LBTCConfig
136126
JobID string
137127
}
138128

@@ -146,30 +136,17 @@ func (e ExecPluginConfig) Encode() ([]byte, error) {
146136

147137
func (uc *USDCConfig) ValidateUSDCConfig() error {
148138
if uc.AttestationAPI == "" {
149-
return errors.New("USDCConfig: AttestationAPI is required")
139+
return errors.New("AttestationAPI is required")
150140
}
151141
if uc.AttestationAPIIntervalMilliseconds < -1 {
152-
return errors.New("USDCConfig: AttestationAPIIntervalMilliseconds must be -1 to disable, 0 for default or greater to define the exact interval")
142+
return errors.New("AttestationAPIIntervalMilliseconds must be -1 to disable, 0 for default or greater to define the exact interval")
153143
}
154144
if uc.SourceTokenAddress == utils.ZeroAddress {
155-
return errors.New("USDCConfig: SourceTokenAddress is required")
145+
return errors.New("SourceTokenAddress is required")
156146
}
157147
if uc.SourceMessageTransmitterAddress == utils.ZeroAddress {
158-
return errors.New("USDCConfig: SourceMessageTransmitterAddress is required")
148+
return errors.New("SourceMessageTransmitterAddress is required")
159149
}
160150

161151
return nil
162152
}
163-
164-
func (lc *LBTCConfig) ValidateLBTCConfig() error {
165-
if lc.AttestationAPI == "" {
166-
return errors.New("LBTCConfig: AttestationAPI is required")
167-
}
168-
if lc.AttestationAPIIntervalMilliseconds < -1 {
169-
return errors.New("LBTCConfig: AttestationAPIIntervalMilliseconds must be -1 to disable, 0 for default or greater to define the exact interval")
170-
}
171-
if lc.SourceTokenAddress == utils.ZeroAddress {
172-
return errors.New("LBTCConfig: SourceTokenAddress is required")
173-
}
174-
return nil
175-
}

core/services/ocr2/plugins/ccip/tokendata/http/http_client.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,18 @@ import (
1212
)
1313

1414
type IHttpClient interface {
15-
// Get issues a GET request to the given url and returns the response body and status code.
15+
// Get issue a GET request to the given url and return the response body and status code.
1616
Get(ctx context.Context, url string, timeout time.Duration) ([]byte, int, http.Header, error)
17-
18-
// Post issues a POST request to the given url with the given request data and returns the response body and status code.
19-
Post(ctx context.Context, url string, requestData io.Reader, timeout time.Duration) ([]byte, int, http.Header, error)
2017
}
2118

2219
type HttpClient struct {
2320
}
2421

25-
func doRequest(ctx context.Context, url string, requestType string, requestBody io.Reader, timeout time.Duration) ([]byte, int, http.Header, error) {
22+
func (s *HttpClient) Get(ctx context.Context, url string, timeout time.Duration) ([]byte, int, http.Header, error) {
2623
// Use a timeout to guard against attestation API hanging, causing observation timeout and failing to make any progress.
2724
timeoutCtx, cancel := context.WithTimeoutCause(ctx, timeout, tokendata.ErrTimeout)
2825
defer cancel()
29-
req, err := http.NewRequestWithContext(timeoutCtx, requestType, url, requestBody)
26+
req, err := http.NewRequestWithContext(timeoutCtx, http.MethodGet, url, nil)
3027
if err != nil {
3128
return nil, http.StatusBadRequest, nil, err
3229
}
@@ -49,11 +46,3 @@ func doRequest(ctx context.Context, url string, requestType string, requestBody
4946
body, err := io.ReadAll(res.Body)
5047
return body, res.StatusCode, res.Header, err
5148
}
52-
53-
func (s *HttpClient) Get(ctx context.Context, url string, timeout time.Duration) ([]byte, int, http.Header, error) {
54-
return doRequest(ctx, url, http.MethodGet, nil, timeout)
55-
}
56-
57-
func (s *HttpClient) Post(ctx context.Context, url string, requestBody io.Reader, timeout time.Duration) ([]byte, int, http.Header, error) {
58-
return doRequest(ctx, url, http.MethodPost, requestBody, timeout)
59-
}

0 commit comments

Comments
 (0)