OnFinality
New RPC users get 35% off their first monthView the offer
OnFinality Learn
Integration & Development9 min read

OpenZeppelin Defender: Architecture, RPC Integration, and Migration Planning

Understand how OpenZeppelin Defender fits into a blockchain operations stack, how to validate its RPC dependencies, and how to plan for its documented sunset.

TL;DR

OpenZeppelin Defender is a developer security and operations platform for building, deploying, monitoring, and operating blockchain applications. Its workflows depend on reliable network access, transaction submission, confirmations, and event retrieval from RPC endpoints. OpenZeppelin has announced a phased sunset of the hosted Defender platform, with a final shutdown planned for July 1, 2026; verify the current status in the official OpenZeppelin announcement before starting a new dependency. This guide explains the operating model, shows reproducible RPC checks, and outlines a practical migration path toward self-managed open-source components.

Current scope and service status

OpenZeppelin Defender should be understood as an operational layer around blockchain applications rather than as a replacement for smart-contract security review. The platform has been positioned for developer security management across activities such as deployment, monitoring, and day-to-day operation. In practice, that means an application may combine audited contract libraries, deployment tooling, transaction automation, monitoring rules, signer controls, and one or more RPC connections.

The most important planning constraint is its announced sunset. OpenZeppelin's June 30, 2025 announcement states that new sign-ups were disabled and that the hosted Defender platform was planned to shut down on July 1, 2026. The sign-in page captured for this article also described the service as operational until that shutdown. These are documented statements, not a guarantee of current availability, so check the official OpenZeppelin announcement and product documentation before relying on Defender for a new production workflow.

For an existing deployment, treat Defender as a dependency to inventory and migrate. For a new deployment, prefer an architecture whose relayer, monitoring, signing, secrets, and RPC layers you can operate independently. The OnFinality API Service can be evaluated as one RPC component, but endpoint selection and network availability must be confirmed for the specific chain and environment.

  • Documented behavior: Defender was a hosted platform for blockchain application security and operations.
  • Documented status: OpenZeppelin announced a phased sunset and a planned final shutdown on July 1, 2026.
  • Recommendation: do not make a new critical system depend on an end-of-life hosted workflow without a tested replacement.

Operational mental model

A useful way to reason about Defender is as a set of boundaries around a blockchain application. Your contracts define state transitions. A deployment workflow publishes contract code and records addresses. A relayer or transaction service submits signed transactions. A monitor observes blocks, logs, or transaction outcomes. An RPC provider supplies the read and write transport between these components and the network.

The RPC endpoint is therefore not merely a URL in a configuration file. Read operations may include chain identity checks, nonce or fee queries, block retrieval, transaction receipts, and event logs. Write operations may include raw transaction submission and subsequent polling for a receipt. A failure in any one of these stages can look like a Defender failure even when the underlying issue is an incorrect chain ID, an unsupported method, a rate limit, a delayed index, or a provider with inconsistent visibility.

Keep signing and transport separate in your design. A private key or external signer authorizes a transaction; an RPC endpoint carries the request to the network. Never put a private key in a browser bundle, source repository, shell history, or a shared monitoring configuration. Store secrets in a dedicated secret manager and give each automation role only the permissions it needs.

  • Contract layer: code, permissions, upgrade controls, and emitted events.
  • Automation layer: scheduled or event-driven actions that decide when to transact.
  • Signing layer: keys, policies, approvals, and nonce ownership.
  • RPC layer: JSON-RPC reads, transaction submission, and confirmation polling.
  • Observability layer: logs, metrics, alerts, and reconciliation against chain state.

Prerequisites and migration assumptions

Before changing an existing Defender workflow, create an inventory rather than starting with code replacement. Record every project, network, contract address, deployment artifact, signer or relayer, monitor rule, webhook, notification destination, RPC URL, rate limit, and operational owner. Include testnets and abandoned-looking projects: a forgotten automation key can still retain authority over a live contract.

You also need a network-specific RPC plan. Confirm the chain's canonical chain ID, the JSON-RPC methods required by your application, whether archive or historical log access is needed, and whether the provider supports the throughput and concurrency pattern of your workload. Use the supported networks directory and the RPC pricing page to compare available service options, then validate behavior with your own workload rather than assuming that a listed network or plan meets every requirement.

For production systems, define a rollback plan before migration. Preserve the old deployment metadata, keep the existing signer disabled but recoverable where policy allows, and test a harmless transaction or read-only monitor in a staging environment. If a workflow controls upgrades, treasury movement, or privileged configuration, require independent review of the new transaction path.

  • A contract address and ABI for every monitored or automated contract.
  • The expected chain ID and network name for every environment.
  • A list of required RPC methods and approximate request concurrency.
  • A secret-management location and key-rotation procedure.
  • An acceptance test covering submission, confirmation, event detection, and alert delivery.

RPC connectivity validation

For an EVM-compatible network, the first response should contain a hexadecimal chain ID matching your deployment configuration. The second should contain a hexadecimal block number that increases over time on an active chain. A valid-looking response from the wrong network is more dangerous than a visible connection error because it can cause transactions or monitoring rules to target the wrong state.

You can automate the same checks in JavaScript. This example uses the standard Fetch API and does not expose a private key or submit a transaction.

  • Compare chainId with the value in deployment and automation configuration.
  • Repeat blockNumber after a short interval and record whether it advances.
  • Run the test from the same region or runtime that will execute production automation.
  • Do not use a real private key for connectivity testing.
const rpcUrl = process.env.RPC_URL;
if (!rpcUrl) throw new Error('Set RPC_URL');
async function rpc(method, params = []) {
  const response = await fetch(rpcUrl, {
    method: 'POST',
    headers: { 'content-type': 'application/json' },
    body: JSON.stringify({ jsonrpc: '2.0', id: Date.now(), method, params })
  });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  const body = await response.json();
  if (body.error) throw new Error(JSON.stringify(body.error));
  return body.result;
}
const chainId = await rpc('eth_chainId');
const blockNumber = await rpc('eth_blockNumber');
console.log({ chainId, blockNumber });

Transaction and event verification

The log example is intentionally generic. Replace the event topic with the Keccak-256 topic for the event you expect, and use a block range appropriate for the network and provider limits. Do not assume that a broad historical query is safe for production monitoring; incremental block checkpoints are usually easier to retry and reconcile.

const expectedChainId = process.env.EXPECTED_CHAIN_ID;
const result = await rpc('eth_chainId');
if (result.toLowerCase() !== expectedChainId.toLowerCase()) {
  throw new Error(`Wrong chain: expected ${expectedChainId}, got ${result}`);
}
const latest = await rpc('eth_blockNumber');
const filter = {
  fromBlock: `0x${(Number.parseInt(latest, 16) - 20).toString(16)}`,
  toBlock: 'latest',
  address: process.env.CONTRACT_ADDRESS,
  topics: [process.env.EVENT_TOPIC]
};
const logs = await rpc('eth_getLogs', [filter]);
console.log(`Matched ${logs.length} logs`);

Measurement and acceptance results

Test caseAttemptsSuccessesError typesMedian latencyP95 latencyNotes
eth_chainId
eth_blockNumber
Contract read
Narrow eth_getLogs query
Staged transaction and receipt
Monitor event delivery

A successful result means more than receiving a JSON-RPC response. The endpoint should return the expected chain, observe advancing state, accept the intended request pattern, expose the receipt, and provide complete event data within the tolerance defined by your application. Store raw failures and transaction hashes so another operator can reproduce the conclusion.

  • Test cases: chain ID, latest block, contract call, narrow event query, transaction submission, receipt polling, and alert delivery.
  • Repeat each read-only case enough times to expose intermittent failures; use a controlled number of staged writes.
  • Compare at least two endpoint configurations only when both are authorized for the same network and workload.
  • Treat error rate, receipt visibility, and event completeness as release criteria, not just average latency.

Troubleshooting failure modes

Wrong-network errors usually begin with a chain ID mismatch, a copied endpoint for another environment, or a stale deployment address. Check eth_chainId, the configured network name, the contract's bytecode at the target address, and the block explorer record if one is available. Never fix a mismatch by changing the expected chain ID until you have verified which value is authoritative.

Submission errors can originate in nonce management, fee configuration, account permissions, or provider policy. If multiple workers share one signer, they may allocate conflicting nonces. Serialize nonce ownership or use a transaction queue with explicit recovery. If a transaction is accepted but its receipt cannot be found, query the same hash through a second authorized endpoint and inspect whether the target network has advanced; do not immediately resubmit a potentially successful transaction.

Monitoring gaps commonly come from oversized block ranges, incorrect topic encoding, reorganization handling, or a process that advances its checkpoint before persisting the matching events. Use bounded ranges, durable checkpoints, idempotent event processing, and a reconciliation job that periodically compares stored state with chain logs.

Rate limits and transient transport failures require backoff, jitter, and bounded retries. Retrying a read is generally safer than retrying a write. For writes, first determine whether the network accepted the transaction hash, then reconcile nonce and receipt state before deciding whether any action is required.

  • HTTP 401 or 403: inspect credentials, project permissions, and endpoint policy.
  • HTTP 429: reduce concurrency, add backoff, and review the service quota.
  • JSON-RPC method errors: confirm network support and method parameters.
  • Stale blocks: compare block height and timestamp across authorized endpoints.
  • Missing events: reduce query ranges and verify address, topics, and reorganization logic.

Hosted services and self-managed tooling

A hosted Defender workflow can reduce the amount of infrastructure your team must assemble, but it also concentrates operational dependency in a vendor-controlled product lifecycle. A self-managed stack gives you more control over deployment, secrets, queues, monitoring, and chain integrations, while making your team responsible for upgrades, availability, incident response, and secure key handling.

OpenZeppelin's announcement describes a shift toward open-source versions of tools such as Relayers and Monitor. That direction may improve customization and portability, but open source does not eliminate operational work. You still need a runtime, persistent storage, secret management, RPC capacity, alert routing, dashboards, backups, and a tested upgrade process.

For teams that need stronger isolation or predictable capacity, evaluate whether a dedicated node is justified by request volume, data requirements, or reliability objectives. For smaller or variable workloads, a managed RPC service with application-level retries and monitoring may be simpler. The correct choice depends on failure tolerance, compliance requirements, operational expertise, and the cost of running redundant components.

  • Hosted approach: faster initial setup, less infrastructure ownership, greater product-lifecycle dependency.
  • Self-managed approach: more control and portability, but more responsibility for security and reliability.
  • Hybrid approach: self-managed automation and signing with managed RPC, or redundant RPC providers behind an application gateway.

Migration sequence and next steps

Begin by freezing the current behavior in tests: network identity, contract addresses, permissions, transaction results, event filters, alert destinations, and recovery procedures. Then separate configuration from business logic so that RPC URLs, signer references, and monitoring backends can change without rewriting contract operations.

Next, deploy the replacement components in a non-production environment. Validate reads, staged writes, receipt polling, event processing, alert delivery, retries, and restart recovery. Run the measurement table for the intended workload and retain the raw output. Only after the acceptance criteria pass should you migrate one low-risk production workflow, observe it through a complete operational cycle, and then expand gradually.

Keep the Defender inventory, migration decision, and provider assumptions current because product status and network support can change. The RPC endpoints guide provides additional background on endpoint selection, while blockchain node hosting guidance can help structure decisions about managed versus self-operated infrastructure.

  • Verify current Defender availability and the official sunset status.
  • Inventory every signer, monitor, deployment, network, endpoint, and alert.
  • Build a provider-independent test suite around JSON-RPC behavior.
  • Migrate low-risk workflows first and retain rollback capability.
  • Review permissions, key rotation, RPC quotas, and event reconciliation after cutover.

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started