feat: support vetiver bridge abi (DX-1812)#72
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds the VETIVER Bridge ABI and registers it for block-aware Bridge release selection, while updating the packaged precompiled ABI dependency and tests.
Changes:
- Registers VETIVER for mainnet/testnet release heights.
- Adds
bridge-vetiver.jsonto source and generateddist/. - Updates dependency lock state and adds ABI decode-oriented tests.
Reviewed changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
test/bridgeAbi.spec.js |
Adds Vetiver release expectations and peg-out fee method decode tests. |
src/lib/nativeContracts/bridgeAbi.js |
Imports and registers the Vetiver ABI release. |
src/lib/nativeContracts/bridge-vetiver.json |
Adds the new Bridge ABI definition. |
package.json |
Bumps @rsksmart/rsk-precompiled-abis to VETIVER. |
package-lock.json |
Locks the updated precompiled ABI package. |
dist/lib/nativeContracts/bridgeAbi.js |
Generated registration update for Vetiver. |
dist/lib/nativeContracts/bridge-vetiver.json |
Generated copy of the Vetiver ABI. |
Comments suppressed due to low confidence (1)
test/bridgeAbi.spec.js:96
- Like the previous case, this encodes and parses with the same ABI, which does not prove the parser recognizes the actual precompile selector for
getEstimatedFeesForNextPegOutEvent()after the Vetiver boundary. A fixed calldata/selector fixture would make this regression test independent of the ABI under test.
const iface = new Interface(vetiver.filter(i => i.type === 'function'))
const data = iface.encodeFunctionData('getEstimatedFeesForNextPegOutEvent', [])
const parsed = iface.parseTransaction({ data })
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bridge-vetiver.json) and registers it inbridgeAbi.jsat mainnet height8804200and testnet height7604200.@rsksmart/rsk-precompiled-abisfrom^8.0.0-REEDto^9.0.0-VETIVER.getEstimatedFeesForPegOutAmount(uint256)and the updatedgetEstimatedFeesForNextPegOutEvent().Why
Rootstock node (RSKj) introduced a new Bridge method
getEstimatedFeesForPegOutAmount(uint256 pegOutAmountInWeis)and updated the semantics ofgetEstimatedFeesForNextPegOutEvent()(now uses the minimum peg-out value instead of 1 BTC). The parser must recognize and decode these so the explorer correctly displays Bridge interactions.Test plan
npm run test:local— 402 passing, including 2 new decode tests for vetiver ABInpm run lint— cleannpm run build—dist/regenerated and consistent withsrc/Notes
getEstimatedFeesForNextPegOutEvent()selector is unchanged — only semantics updated.