Documentation
¶
Index ¶
- func ExecuteRecovery(ctx context.Context, cfg *Config, env *Env, diagnosis *DiagnosisResult) error
- func GetClaimsByGER(ctx context.Context, bridgeService *client.Client, networkID uint32, ...) ([]*bridgesync.Claim, error)
- func PrintDiagnosis(result *DiagnosisResult)
- func Run(c *cli.Context) error
- type BridgeData
- type ClaimDiagnosis
- type Config
- type DiagnosisResult
- type Env
- type GERExistsOnL1Error
- type RemoveGERConfig
- type Scenario
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteRecovery ¶
ExecuteRecovery runs the recovery flow for the given diagnosis. All steps execute on L2. On any error, returns immediately; the bridge may remain in emergency state for manual intervention.
func GetClaimsByGER ¶
func GetClaimsByGER( ctx context.Context, bridgeService *client.Client, networkID uint32, gerHash common.Hash, ) ([]*bridgesync.Claim, error)
GetClaimsByGER queries the bridge service for DetailedClaimEvent claims that used the given GER. networkID specifies which network to query (0 for L1, L2 network ID otherwise). Exported so E2E tests can use the same query for wait and assertion as the tool.
func PrintDiagnosis ¶
func PrintDiagnosis(result *DiagnosisResult)
PrintDiagnosis prints a human-readable diagnosis summary and recovery plan to stdout.
Types ¶
type BridgeData ¶
type BridgeData struct {
LeafType uint8
OriginNetwork uint32
OriginAddress common.Address
DestinationNetwork uint32
DestinationAddress common.Address
Amount *big.Int
Metadata []byte
DepositCount uint32
}
BridgeData holds L1 bridge fields needed for comparison and for CorrectBridge (B.1/B.2).
type ClaimDiagnosis ¶
type ClaimDiagnosis struct {
GlobalIndex *big.Int
DepositCount uint32
OriginNetwork uint32
Category Scenario
CorrectBridge *BridgeData // nil for Category A
}
ClaimDiagnosis holds the classification for a single claim.
type Config ¶
type Config struct {
// L1NetworkConfig contains the L1 RPC URL and contract addresses.
L1NetworkConfig ethermanconfig.L1NetworkConfig `mapstructure:"L1NetworkConfig"`
// Common contains shared settings such as the L2 RPC URL.
Common ethermanconfig.CommonConfig `mapstructure:"Common"`
// BridgeL2Sync contains the L2 bridge contract address used to initialize the binding.
BridgeL2Sync bridgesync.Config `mapstructure:"BridgeL2Sync"`
// L2GERSync contains the L2/L1 GER contract addresses.
L2GERSync l2gersync.Config `mapstructure:"L2GERSync"`
RemoveGER RemoveGERConfig `mapstructure:"RemoveGER"`
}
Config holds the subset of aggkit configuration fields needed by the remove-GER tool, plus tool-specific settings in the RemoveGER section.
func LoadConfig ¶
LoadConfig reads the TOML config file(s) specified by --cfg and unmarshals the fields required by the remove-GER tool. Uses the same template rendering pipeline as the main aggkit binary so that template variables (e.g. L1URL → L1NetworkConfig.RPC.URL) are resolved correctly.
type DiagnosisResult ¶
type DiagnosisResult struct {
InvalidGER common.Hash
GERExistsOnL1 bool
GERExistsOnL2 bool
GERTimestampL2 *big.Int
Claims []ClaimDiagnosis
Scenario Scenario
}
DiagnosisResult holds the result of the diagnosis phase.
type Env ¶
type Env struct {
// RPC clients
L1 *ethclient.Client
L2 *ethclient.Client
// Bridge service REST client (required)
BridgeService *client.Client
// L2NetworkID is the network ID of the L2 network served by the bridge service.
L2NetworkID uint32
// L1 contract bindings
L1GERManager *agglayerger.Agglayerger
// L2 contract bindings
L2Bridge *agglayerbridgel2.Agglayerbridgel2
L2GERManager *agglayergerl2.Agglayergerl2
}
Env holds all connections and contract bindings needed by the remove-ger tool. Pass it to diagnosis and recovery methods in later chunks.
type GERExistsOnL1Error ¶
GERExistsOnL1Error is returned when the GER exists on L1 (not invalid) and --force was not set.
func (GERExistsOnL1Error) Error ¶
func (e GERExistsOnL1Error) Error() string
type RemoveGERConfig ¶
type RemoveGERConfig struct {
// SovereignAdminKey is the signing key with privileges to:
// - activateEmergencyState / deactivateEmergencyState on the L2 bridge
// - removeGlobalExitRoots on the L2 GER manager
// - unsetMultipleClaims / setMultipleClaims on the L2 bridge
// - forceEmitDetailedClaimEvent on the L2 bridge
// Supports local keystore, AWS KMS, and GCP KMS via signertypes.SignerConfig.
SovereignAdminKey signertypes.SignerConfig `mapstructure:"SovereignAdminKey"`
// BridgeServiceURL is the URL of the aggkit bridge service REST API (required).
// Used for querying claims, bridges, and proofs.
BridgeServiceURL string `mapstructure:"BridgeServiceURL"`
// L2NetworkID is the network ID of the L2 network served by the bridge service.
// Required for querying L2 claims via the bridge service.
L2NetworkID uint32 `mapstructure:"L2NetworkID"`
}
RemoveGERConfig contains configuration specific to the remove-GER tool.