Skip to content
DoS Audit finding Advanced

Win all relayer rewards

The report argues that a separate issue involving large or rapidly changing validator sets could knock out most relayers while leaving the oracle working, so valid attestations still exist but other relayers cannot take part in execution. With the attacker's node as the only relayer still running, it could collect all batch, logic and valset rewards.

nascent Follow

Originally disclosed on Code4rena

Submitted by nascent

“Large Validator Sets/Rapid Validator Set Updates May Freeze the Bridge or Relayer” can affect just the relayers & not affect the oracle in certain circumstances. This could result in valid attestations, but prevent any of the other relayers from being able to participate in the execution. While the other relayers are down from the other attack, the attacker can win all batch, logic, and valset rewards as their node is the only relayer running. This is possible because find_latest_valset is run in the main relayer loop and everytime tries for 5000 blocks of logs.

jkilpatr (Althea) confirmed:

This is a reasonable consequence of #6

I consider it medium risk because it reduces the number of relayers active, not because of the reward assignment

The original report as published on Code4rena, by nascent. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The finding, submitted by nascent to the Code4rena audit of the project, is titled "Win all relayer rewards" and was rated medium severity.

The researcher builds on a separate issue, "Large Validator Sets/Rapid Validator Set Updates May Freeze the Bridge or Relayer". Their point is that this freeze can, under certain circumstances, affect only the relayers and leave the oracle unaffected. The chain would then still accept valid attestations, but the other relayers would be unable to take part in execution. With every other relayer knocked out by the freeze, the attacker's node is the only relayer still running, and it collects all of the batch, logic and valset rewards.

The mechanism the report names is find_latest_valset, which runs inside the main relayer loop and, on every pass, scans 5000 blocks of logs. The report does not give the code for this function or describe the freeze itself in more detail.

The maintainer, jkilpatr of Althea, confirmed the finding and commented that it is a reasonable consequence of issue #6. He rated it medium risk because it reduces the number of active relayers, not because of the reward assignment. No bounty figure, fix or disclosure date is given.

Root cause

The report ties the issue to find_latest_valset, which runs in the main relayer loop and tries for 5000 blocks of logs each time. It frames the reward concentration as a consequence of the validator-set freeze issue rather than an independent defect. The report frames this as a consequence of the validator-set freeze issue rather than an independent defect, so the reward concentration is a secondary effect of an availability problem in the relayer loop.

Impact

The report keeps its claims conditional: the freeze affects relayers and not the oracle "in certain circumstances". Where that holds, attestations remain valid but other relayers cannot participate in execution. The attacker's node, as the only relayer still running, wins all batch, logic and valset rewards. The maintainer's assessment is that the real risk is the reduction in the number of active relayers, with the reward assignment treated as a lesser concern.

How this kind of bug works

Off-chain agents such as relayers, oracles and keepers usually run a loop that polls the chain for events, filters them, and acts on what it finds. Two design choices make such loops fragile. First, the work per iteration can grow with chain state: a wider log window, a larger validator set or a busier contract all increase the cost of a single pass. Second, the loop may be the only path to liveness, so if one pass takes too long, the agent falls behind and never catches up.

If the agent is permissionless and rewarded per action, the same pressure that removes honest participants concentrates rewards on whoever can still keep up. The bug class is therefore a denial of service against an off-chain participant, with an economic side effect. Defences are about bounding work per iteration, decoupling expensive scans from the hot loop, and making sure a single slow component cannot stop the whole agent.

How to test for it

  1. Identify the off-chain agents in scope and how they are rewarded. Look for relayer, oracle, keeper or watcher binaries and the reward logic that pays them.
  2. Read the main loop. Note every call that scans logs, iterates over sets or fetches state, and check whether the amount of work is fixed or grows with chain state.
  3. Find the inputs that drive that work: validator set size, update frequency, log volume, number of events per block. These are the levers an attacker controls.
  4. Reproduce locally. Run the agent against a test chain, then grow the relevant state (for example by adding validators or emitting many events) and measure how long each loop iteration takes and whether the agent keeps up.
  5. Watch for the failure mode: the agent stops processing new blocks, lags behind the head, or misses actions that other participants complete. A positive result is a measurable stall caused by state you can influence, not by your own resource limits.
  6. Check the economic consequence. If rewards are paid per action and the stall removes competitors, show that a single remaining agent captures the rewards.

Common false positives: a slow loop caused by your own underpowered machine or network; a stall that also breaks the oracle or the chain itself, which changes the impact; and state growth that no attacker can trigger in practice because it requires governance or privileged action.

How it is fixed

  • Bound the work per iteration: scan a smaller, incremental window and track a cursor instead of re-reading a fixed large range every time.
  • Move expensive scans off the hot path, for example into a separate task that updates cached state the main loop reads.
  • Add backpressure and catch-up logic so a slow pass does not permanently desynchronise the agent.
  • Make reward distribution resilient to a single active participant, so that liveness problems do not automatically concentrate rewards.
  • Add monitoring and alerts for relayer lag so operators notice a stall early.

Hunting notes

This class tends to hide in permissionless off-chain roles: bridge relayers, oracle feeders, liquidation bots, indexers and challenge watchers. Recon signals include reward logic tied to per-action payments, loops that scan fixed block ranges, and any state that grows without a hard cap, such as validator sets or event logs. Audit reports and issue trackers for the project often name the loop function directly, which gives you a starting point.

To get a report accepted, show the stall reproducibly and tie it to a concrete loss: missed actions, concentrated rewards or a liveness gap. Keep the claim conditional where the effect depends on chain state, as this report does, and separate the availability problem from the economic one so reviewers can rate each on its own merits.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What happened, in plain words

Relayers are paid rewards for batch, logic and valset work.

A validator set is the list of computers that agree on what is true on a blockchain. When that list is large, or changes very quickly, the relayer software has more to read and check.

The researcher, nascent, submitted this finding to the Code4rena audit of Gravity Bridge. The title is "Win all relayer rewards" and the severity is medium. It builds on a separate issue called "Large Validator Sets/Rapid Validator Set Updates May Freeze the Bridge or Relayer". That issue describes a freeze: a situation where the relayer software gets stuck and stops doing its job.

The new point here is narrower. The freeze can, in certain circumstances, hit only the relayers and leave the oracle untouched. So the chain still receives valid attestations, but the other relayers cannot take part in executing the work. With every other relayer knocked out, the attacker's node is the only relayer still running, and it collects all of the batch, logic and valset rewards.

The mechanism named in the report is find_latest_valset. This function runs inside the main relayer loop, the repeating cycle of work the software performs, and on every pass it scans 5000 blocks of logs.

The maintainer, jkilpatr of Althea, confirmed the finding and wrote that it is a reasonable consequence of issue #6. He rated it medium risk because it reduces the number of active relayers, not because of the reward assignment.

Why it matters

The report keeps its claim conditional: the freeze affects relayers and not the oracle "in certain circumstances". Where that holds, attestations stay valid, but the other relayers cannot participate in execution, and the attacker's node wins all batch, logic and valset rewards.

The maintainer's view is that the real risk is the drop in the number of active relayers, with the reward concentration treated as a lesser concern.

In general, how this kind of bug works

Software that runs outside the chain, such as relayers, oracles and keepers, usually follows the same pattern: a loop that asks the chain what happened, filters the answer, and acts on it. Two design choices make such loops fragile.

  1. The work per pass can grow with the state of the chain. A wider log window, a larger validator set or a busier contract all make a single pass more expensive.
  2. The loop may be the only path to liveness. If one pass takes too long, the agent falls behind and never catches up.

When the cost of a pass depends on state an adversary can influence, the adversary can push the agent past its budget. If the role is open to anyone and paid per action, the same pressure that removes honest participants concentrates rewards on whoever can still keep up. The bug class is a denial of service against an off-chain participant, with an economic side effect.

In general, how to test for it

  1. Identify the off-chain agents in scope and how they are rewarded. Look for relayer, oracle, keeper or watcher binaries and the reward logic that pays them.
  2. Read the main loop. Note every call that scans logs, iterates over sets or fetches state, and check whether the amount of work is fixed or grows with chain state.
  3. Find the inputs that drive that work: validator set size, update frequency, log volume, number of events per block. These are the levers an attacker controls.
  4. Reproduce locally. Run the agent against a test chain, then grow the relevant state, for example by adding validators or emitting many events, and measure how long each loop iteration takes and whether the agent keeps up.
  5. Watch for the failure mode: the agent stops processing new blocks, lags behind the head, or misses actions that other participants complete. A positive result is a measurable stall caused by state you can influence, not by your own resource limits.
  6. Check the economic consequence. If rewards are paid per action and the stall removes competitors, show that a single remaining agent captures the rewards.

Common false positives: a slow loop caused by your own underpowered machine or network; a stall that also breaks the oracle or the chain itself, which changes the impact; and state growth that no attacker can trigger in practice because it requires governance or privileged action.

In general, how it is fixed

  • Bound the work per iteration: scan a smaller, incremental window and track a cursor instead of re-reading a fixed large range every time.
  • Move expensive scans off the hot path, for example into a separate task that updates cached state the main loop reads.
  • Add backpressure and catch-up logic so a slow pass does not permanently desynchronise the agent.
  • Make reward distribution resilient to a single active participant, so that liveness problems do not automatically concentrate rewards.
  • Add monitoring and alerts for relayer lag so operators notice a stall early.

In general, where to look

This class tends to hide in permissionless off-chain roles: bridge relayers, oracle feeders, liquidation bots, indexers and challenge watchers. Recon signals include reward logic tied to per-action payments, loops that scan fixed block ranges, and any state that grows without a hard cap, such as validator sets or event logs. Audit reports and issue trackers for the project often name the loop function directly, which gives you a starting point.

To get a report accepted, show the stall reproducibly and tie it to a concrete loss: missed actions, concentrated rewards or a liveness gap. Keep the claim conditional where the effect depends on chain state, as this report does, and separate the availability problem from the economic one so reviewers can rate each on its own merits.

Glossary

  • Relayer: an independent program that watches a blockchain and carries messages or proofs to another chain, earning rewards for the work.
  • Oracle: the component that produces attestations, the signed statements the chain accepts as proof of what happened elsewhere.
  • Attestation: a signed claim that a particular event occurred, used by the chain to decide whether to act.
  • Validator set (valset): the list of computers that agree on the state of a blockchain at a given time.
  • Block: a bundle of transactions plus the records the chain writes when they execute.
  • Log: a record written by the chain when something happens, which off-chain software can read.
  • Main loop: the repeating cycle of work an off-chain program performs: read the chain, filter, act, repeat.
  • find_latest_valset: a function in the relayer; in this report it runs in the main loop and tries for 5000 blocks of logs each time.
  • Denial of service: making a system or service unavailable to its legitimate users, here by making a relayer too slow to keep up.
  • Liveness: the property that a system keeps making progress; a liveness gap is a period where it does not.
  • Reward: payment made to a relayer for completing an action.
  • Severity: the rating given to a finding, here medium, reflecting how serious the impact is judged to be.
  • False positive: a reported problem that turns out not to be a real, exploitable issue.

More by nascent

View all

4 more disclosed reports, best first.

More from Gravitybridge

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.