Prerequisites
Before deploying Gasolina, ensure you have:| Requirement | Details |
|---|---|
| Cloud Provider Account | AWS account with CDK permissions, or GCP account with billing enabled |
| Node.js | Version 18 or higher |
| Package Manager | npm, yarn, or pnpm |
| Cloud CLI | AWS CLI + CDK CLI, or gcloud CLI + Terraform |
| RPC Providers | Reliable endpoints for each supported chain (2+ per chain recommended) |
AWS Implementation
Step 1: Clone and Setup
Step 2: Configure AWS Authentication
Step 3: Choose Signer Type
You have two options for managing signing keys:- AWS KMS (Recommended)
- Mnemonic-based
AWS KMS provides HSM-backed signing keys that are automatically created and managed:
- Set
signerType: 'KMS'in your configuration - Specify
kmsNumOfSignersfor the number of keys to create - Keys are automatically created during CDK deployment
- Hardware security module protection
- Automatic key rotation support
- No manual secret management
Step 4: Configure Infrastructure
Editcdk/gasolina/config/index.ts:
| Config Option | Description |
|---|---|
projectName | Unique project identifier (used for S3 bucket naming) |
environment | mainnet or testnet |
availableChainNames | Comma-separated list of supported chains |
signerType | KMS for HSM-backed or MNEMONIC for secret-based |
kmsNumOfSigners | Number of KMS signing keys to create |
extraContextGasolinaUrl | Optional custom verification endpoint |
Step 5: Configure RPC Providers
Editcdk/gasolina/config/providers/mainnet/providers.json:
Step 6: Configure Wallet Definitions (Mnemonic Only)
If using mnemonics, editcdk/gasolina/config/walletConfig/mainnet.json:
Step 7: Bootstrap CDK (First Time Only)
Step 8: Deploy Infrastructure
Step 9: Test Deployment
Google Cloud Platform Implementation
Step 1: Clone and Setup
Step 2: Configure GCP Project
Step 3: Create Terraform Backend Storage
Step 4: Configure Terraform Backend
Editterraform/lz-mainnet-verifier.backend.conf:
Step 5: Configure Infrastructure Variables
Editterraform/lz-mainnet-verifier.tfvars:
Step 6: Configure RPC Providers
Editterraform/providers-mainnet.json:
Step 7: Deploy with Terraform
Step 8: Test Deployment
Integration with LayerZero
Once your Gasolina instance is deployed and tested:Step 1: Share Gasolina URL
Provide your Gasolina API URL to LayerZero Labs:Step 2: DVN Contract Deployment
LayerZero will:- Query your
/signer-infoendpoint to retrieve signer addresses - Deploy DVN contracts on all supported chains with:
- Your signer addresses registered
- Agreed-upon quorum threshold
- Essence wallet as initial
ADMIN_ROLEholder
- Provide you with the DVN contract addresses for each chain
Step 3: OApp Configuration
OApps configure your DVN using the contract addresses:Advanced Configuration
Extra Context Verification
Add custom verification logic by implementing an API endpoint:Multi-Signer Setup
For enhanced security and availability, deploy multiple Gasolina instances with different signers:| Instance | Endpoint | Signers |
|---|---|---|
| Gasolina 1 | https://gasolina1.example.com | Signers A, B |
| Gasolina 2 | https://gasolina2.example.com | Signers C, D |
| Gasolina 3 | https://gasolina3.example.com | Signers E, F |
Managing Configuration Changes
As a Gasolina operator, you maintain full control over the DVN through the signer quorum.Change Quorum Threshold
Add a Signer
Remove a Signer
Emergency Admin Takeover
The DVN contract includes aquorumChangeAdmin function that allows the signer quorum to reassign the admin role without requiring the current admin’s permission. This ensures signers maintain ultimate control over the DVN even if the admin role has been delegated to a service like Essence.
ExecuteParam Structure
The function accepts a singleExecuteParam struct:
Step-by-Step Implementation
Step 1: Prepare the ParametersValidation Requirements
The contract validates:| Check | Requirement |
|---|---|
| Expiration | expiration > block.timestamp |
| Target | target == address(this) (the DVN contract) |
| VID | vid == contract.vid |
| Signatures | Must meet quorum, sorted by signer address |
| Replay | Hash must not have been used before |
Operational Management
Monitoring
- AWS
- GCP
- CloudWatch Logs: Automatic log collection
- CloudWatch Alarms: Set up error rate monitoring
- SNS Notifications: Configure alerts
Scaling
| Platform | Scaling Method |
|---|---|
| AWS | ECS auto-scales based on CPU/memory thresholds |
| GCP | Cloud Run auto-scales based on request volume |
Key Rotation
KMS Keys (Recommended)- AWS KMS supports automatic key rotation
- Update DVN contract if key ID changes
- Generate new mnemonic
- Update Secrets Manager
- Update wallet configuration
- Redeploy application
- Update DVN contract with new signer addresses
Troubleshooting
Common Issues
| Issue | Solution |
|---|---|
| ”API has not been used in project” (GCP) | Wait a few minutes for API enablement to propagate |
| ”Resource already exists” (AWS) | Delete GasolinaMetricLogGroup and S3 bucket, retry |
| RPC connection failures | Verify endpoints, check API keys, add backup providers |
| Signature verification failures | Ensure signer addresses match DVN contract config |
Debug Commands
Production hardening checklist
A Gasolina deployment that signs production attestations is part of the trust boundary of every OApp using your DVN. The checklist below is the minimum hardening posture before signing for mainnet messages.API Gateway / network perimeter
- WAF enabled. Rate limits, payload-size limits, common-injection rule sets attached.
<verify default in templates> - IAM authentication required on every endpoint that accepts signed-request inputs. No anonymous endpoints in production.
<verify default in templates> - IP allowlist restricts API Gateway access to the specific upstream callers you expect (LayerZero Endpoint workers, your own monitoring, integrators if applicable).
<verify default in templates> - No public-binding on the worker process itself. The signer process must be in a private VPC subnet, reachable only via the API Gateway / load balancer.
<verify default in templates> - TLS 1.2+ enforced end-to-end, including internal hops between API Gateway and worker.
- mTLS between API Gateway and worker if your threat model requires defense against a compromised internal-network attacker.
- No introspection / health endpoints that disclose the configured RPC providers, signer counts, or service identifiers to unauthenticated callers.
<verify default in templates>
RPC providers (providers.json)
The DVN’s correctness depends entirely on what its RPCs tell it about the source chain. Treat RPC infrastructure as part of the trust boundary.
-
quorum >= 2for every chain. Aquorum: 1configuration means a single compromised RPC can feed forged source-chain data and the DVN will sign attestations of events that did not occur.<verify default in templates> - All configured RPCs treated as primary, not as failover. Backup-only RPCs do not contribute to consensus and reduce the effective quorum.
- At least 3 RPC providers per chain for any production deployment. More for chains where your DVN is high-volume.
- Provider diversity — no two RPCs sharing infrastructure (e.g., not two endpoints from the same vendor’s load balancer; not two self-hosted nodes on the same cloud).
- Documented RPC selection rationale — record why each RPC was chosen, when it was last reviewed, and the conditions under which it would be replaced.
- Active drift monitoring — alert on disagreement between RPCs at the same block. Disagreement that exceeds a baseline rate is an attack indicator.
- Reorg-aware confirmation depth — your DVN’s
confirmationsvalue must exceed the source chain’s typical reorg depth by a margin appropriate to the attestation value at stake.
Configuration storage
- Provider config (
providers.json, signer-set, quorum settings) is hash-pinned and version-controlled. Mutable storage (e.g., a writable S3 bucket without object lock or with broad write IAM) is a configuration-rotation attack surface.<verify default in templates> - Object Lock or equivalent immutability on configuration object storage where supported.
- Versioned access logs on every read and write of configuration objects. Read access is a useful pre-attack signal; write access without a corresponding governance change is an exfiltration or pre-positioning indicator.
- Config changes require a multi-party process (e.g., PR + multi-sign approval + deployment). No single operator should be able to rotate
providers.jsonto attacker-controlled endpoints unilaterally.
Binary integrity
- SHA256 attestation on every binary deployed to a signer node. The attestation is verified before the binary runs.
- Reproducible builds of the DVN worker, with the build pipeline documented publicly.
- Signed releases — release artifacts published with cryptographic signatures from the build pipeline.
- Supply-chain pinning — package manifests pin to specific versions or hashes; CI fails on drift.
- Runtime integrity check (file-integrity monitoring on the running node) detects post-deployment binary swaps.
Key management
- HSM or cloud-KMS-backed signing keys in production. No long-lived keys in plaintext on disk.
- Documented rotation policy — keys rotate on a defined cadence and on suspicion of compromise.
- Multi-party signing where supported (threshold signatures across operators reduces the impact of a single signer’s key compromise).
- Audit log on every signing operation, retained for incident-response.
Monitoring and detection
- Per-pathway attestation latency is tracked; alerts fire on attestations that are unusually fast (possible pre-positioning), unusually slow (possible degradation), or in non-canonical block ranges.
- Source-chain ↔ destination-chain reconciliation runs continuously; alerts fire on attestations that don’t correspond to source-chain emit events.
- Configuration drift detection alerts on changes to
providers.json, signer-set, or quorum settings. - Authentication-failure / authorization-failure rates are alerted (probe activity is an attack precursor).
- RPC divergence rate alerted (see “RPC providers” above).
- On-call rotation receives alerts. A monitoring dashboard nobody is paged on is not a control.
Incident response
- Documented kill-switch — how to stop the DVN from signing within minutes of detection. Tested in a non-production environment within the last quarter.
- Isolation playbook — how to remove a compromised RPC, signer, or node from the active set without taking the whole DVN offline.
- Communication path to integrators using your DVN, kept current.
Security best practices (summary)
The production hardening checklist above supersedes the items below. The list is retained as a quick reference.-
Key Management
- Use HSM-backed keys (KMS) for production
- Implement key rotation policies
- Monitor key usage patterns
-
Network Security
- Restrict API Gateway access (WAF, IAM auth, IP allowlist required for production)
- Use VPC endpoints for internal communication
- Do not bind the worker process to a public IP
-
Monitoring
- Set up alerts for unusual signature request patterns
- Monitor RPC provider response times and divergence
- Track error rates and latency
-
Backup and Recovery
- Backup configuration regularly
- Document recovery procedures
- Test disaster recovery plans periodically
Repository Links
| Resource | Link |
|---|---|
| AWS Infrastructure | gasolina-aws |
| GCP Infrastructure | gasolina-gcp |
| DVN Contract | DVN.sol |
Next Steps
- Gasolina Overview - Architecture and security model
- DVN Technical Reference - Contract methods and events
- DVN Overview - General DVN concepts
For implementation support, reach out through LayerZero Discord or open an issue in the respective GitHub repository.