Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
c8c34ba
feat: init attestor service
nnn-gif Jul 4, 2025
4903b17
feat: separate concerns
nnn-gif Jul 4, 2025
7c11f3f
feat: use eip712 signatures
nnn-gif Jul 8, 2025
0ddc1fb
feat: polling time in ms
nnn-gif Jul 9, 2025
fe2580f
feat: use intent for trigger and receiver
nnn-gif Jul 15, 2025
15ad5cd
feat: forward and backward sync
nnn-gif Jul 22, 2025
be1c764
feat: add transaction retry mechanism
nnn-gif Jul 28, 2025
71bce3e
feat: multiple rpc per chain
nnn-gif Jul 28, 2025
e608770
feat: change config format
nnn-gif Jul 29, 2025
0b2d7fd
feat: add generic events parsing
nnn-gif Jul 30, 2025
f2c4e89
feat: update attestor to remove consumer
nnn-gif Jul 30, 2025
44af31d
feat: add logging in attestor
nnn-gif Jul 30, 2025
e118700
feat: add monitoring
nnn-gif Jul 31, 2025
ac83bf7
chore: move private key to env
nnn-gif Jul 31, 2025
6fd7857
feat: include db migrations
nnn-gif Aug 1, 2025
8829743
fix: add debug logging to trace signature corruption in bridge failov…
nnn-gif Aug 2, 2025
5fe81d9
feat: refactor attestor
nnn-gif Aug 2, 2025
8a70699
feat: bridge to use grpc as comm
nnn-gif Aug 4, 2025
c90efaf
feat: update monitoring to use grpc
nnn-gif Aug 4, 2025
71c4c6f
chore: add logging
nnn-gif Aug 4, 2025
4b334e3
feat: update metrics from request coming from grpc
nnn-gif Aug 7, 2025
5dbea08
feat: add grafana dashboard
nnn-gif Aug 7, 2025
ce3fde7
feat: grafana split event based on receiver
nnn-gif Aug 8, 2025
d0fac9b
feat: update router logic
nnn-gif Aug 12, 2025
be276f7
chore: update protobuff
nnn-gif Aug 12, 2025
f5a3e49
feat: bridge to support randomness transactions
nnn-gif Aug 12, 2025
efb3d03
chore: curresnt state
nnn-gif Aug 12, 2025
4202c68
chore: update state readme
nnn-gif Aug 12, 2025
0661f42
chore: split PushOraclereceiver with v2 and old veriosn
nnn-gif Aug 19, 2025
18f9dbb
feat: refactor oracletrigger
nnn-gif Aug 19, 2025
79439fe
feat: add PushOraclereceiverv2 contract
nnn-gif Aug 19, 2025
6049152
feat: move common intent methods to library
nnn-gif Aug 20, 2025
d115a76
revert: restore OracleTrigger and IOracleTrigger to commit 89eb5414
nnn-gif Aug 21, 2025
641ab97
feat: create Oracletriggerv2
nnn-gif Aug 21, 2025
4928b35
feat: oracletriggerv2 and PushOracleReceiverV2 add validations and do…
nnn-gif Aug 25, 2025
304e692
feat: use libs in PushOracleReceiverV2
nnn-gif Aug 25, 2025
ec8f984
chore: fix lining warnings
nnn-gif Aug 25, 2025
1f27044
feat: add tests
nnn-gif Aug 26, 2025
406b8cd
feat: update tests of PushOracleReceiverv2
nnn-gif Aug 26, 2025
b53d270
chore:add event for transferOwnership in OracleIntentregistry
nnn-gif Aug 27, 2025
02d7b3c
feat: add tests for PushOracleReceiverV2
nnn-gif Aug 27, 2025
e09b4a5
feat: change event TokensRecovered emit order
nnn-gif Aug 27, 2025
b615044
fix: balance check condition
nnn-gif Aug 27, 2025
4347b30
fix: IOracleIntentRegistry version
nnn-gif Aug 27, 2025
9ff7d00
feat: add event when stale update is received: IntentBasedStaleUpdate…
nnn-gif Aug 27, 2025
4f32e1d
feat: make IntentRegistry and Oracletrigger intenttype aware
nnn-gif Aug 29, 2025
5233856
feat: add more tests for OracleIntentRegistry
nnn-gif Aug 29, 2025
16d4e84
chore: fix comment
nnn-gif Aug 29, 2025
e6f0431
feat: remove expiry checks from PushOracleReceiverV2
nnn-gif Aug 31, 2025
8ecd327
feat: use common logger accross services
nnn-gif Aug 31, 2025
595d9c6
feat: fix dockerfiles
nnn-gif Aug 31, 2025
904f540
fix: remove incorrect overflow check
nnn-gif Sep 1, 2025
e02e395
Merge pull request #10 from diadata-org/intentbased
nnn-gif Sep 1, 2025
dce24fb
fix: add expire check in registerIntent L1
nnn-gif Sep 5, 2025
8bace67
fix: setDomainSeparator function from OracleTriggerV2 L2
nnn-gif Sep 5, 2025
07bced9
fix: calculate domainseparator in case of fork L7
nnn-gif Sep 5, 2025
4aab777
fix: remove unused Code Documentation For Non-Existent Function L4
nnn-gif Sep 5, 2025
ae53080
fix: Zero Address Signer Risk L9
nnn-gif Sep 5, 2025
12619b1
fix: strictly check if contract has balance for update L14
nnn-gif Sep 5, 2025
e82b546
fix: add amount param while retrive lst tokens L13
nnn-gif Sep 6, 2025
9315e98
fix: types l11
nnn-gif Sep 6, 2025
298af64
fix: Signature Malleability Vulnerability in recoverSigner() L3
nnn-gif Sep 6, 2025
6a0aad6
fix: increase payloads length to check intent format L10
nnn-gif Sep 7, 2025
32b3614
fix: emit Intent Reject reason event L12
nnn-gif Sep 7, 2025
e84c67d
fix: emit event in PushOraclereceiverV2 while batch process L12
nnn-gif Sep 7, 2025
f6d275c
fix: ignore unauthorised signer intent
nnn-gif Sep 8, 2025
7bffe23
fix: Intent Creation timestamp must be less that block timestamp M2
nnn-gif Sep 8, 2025
70e247e
fix: remove overflow tests for unrealistic gas values
nnn-gif Sep 8, 2025
e0899ac
fix: add minimum fee per trasanction L14
nnn-gif Sep 8, 2025
8521b81
fix: A mandatory fee has been added on top of the gas fee. L14
nnn-gif Sep 8, 2025
b9657d9
fix: add natspec comments
nnn-gif Sep 8, 2025
014f101
fix: enforce fee for transactions not on updates M1
nnn-gif Sep 9, 2025
0a321c4
fix: rename function name in comment
nnn-gif Sep 9, 2025
31f455b
fix: make _processIntent consistent on both handleIntentUpdate and ha…
nnn-gif Sep 9, 2025
0bd0baf
fix: code alignement
khawlahssn Sep 9, 2025
11d08c3
chore: remove dead code
nnn-gif Sep 10, 2025
9920404
chore: add basic test util
nnn-gif Sep 11, 2025
5657322
feat: rename client as read and write
nnn-gif Sep 11, 2025
7f555e6
feat: add resolve param to cover all contracts
nnn-gif Sep 11, 2025
eae770b
fix: use contract address from router
nnn-gif Sep 12, 2025
449d4b8
feat: add tests for enricher
nnn-gif Sep 13, 2025
fc09def
feat: add unit test and enhanced processor
nnn-gif Sep 14, 2025
6825c31
feat: add scanner integration test
nnn-gif Sep 14, 2025
a85d3d3
Merge pull request #12 from diadata-org/auditfix-bridge
nnn-gif Sep 15, 2025
8ac80aa
feat: add tests fro router
nnn-gif Sep 15, 2025
2bf6d65
feat: add router to query by event names
nnn-gif Sep 15, 2025
a310027
feat: add detection time
nnn-gif Sep 16, 2025
02abe88
feat: forge wrapper cli
nnn-gif Sep 18, 2025
2af1e8f
fix: update package.json
nnn-gif Sep 18, 2025
9ab1cab
feat: add cache for scanner
nnn-gif Sep 24, 2025
0d6bd7f
feat: add time threshold
nnn-gif Sep 24, 2025
7280850
feat: add context in cli
nnn-gif Sep 25, 2025
e1c8774
feat: update attestor
nnn-gif Sep 26, 2025
69dc38c
feat: add option for ISM
nnn-gif Sep 26, 2025
80b6be5
feat: updater to use oracletriggerv2
nnn-gif Sep 26, 2025
852c7b9
chore: move bridge,attestor to single directory
nnn-gif Sep 26, 2025
f56e08b
chore: move attestor to service
nnn-gif Sep 26, 2025
8aa3946
chore: remove leftover test file
nnn-gif Sep 26, 2025
d0acb4f
chore: move docker files
nnn-gif Sep 26, 2025
0b54086
chore: move monitor files to services
nnn-gif Sep 26, 2025
533cab6
chore: remove duplicate proto files
nnn-gif Sep 26, 2025
8502a81
chore: remove unused methoda
nnn-gif Sep 26, 2025
e526ac2
chore: close clint
nnn-gif Sep 26, 2025
306a38b
chore: add attestor ci
nnn-gif Sep 26, 2025
dc14e87
chore: run lint on attestor
nnn-gif Sep 26, 2025
767389d
feat: domain and version from env var
nnn-gif Sep 26, 2025
daa8da0
chore: delete unused files
nnn-gif Sep 26, 2025
047301e
feat: reuse multi client
nnn-gif Sep 26, 2025
38dcf79
fix: wait for all routine when shutting down
nnn-gif Sep 27, 2025
e23dbc6
feat: add local test env
nnn-gif Sep 27, 2025
4a14807
feat: update local test env
nnn-gif Sep 28, 2025
42b7575
feat: fix transaction conversion
nnn-gif Sep 28, 2025
3c8f423
feat: add ci for bridge
nnn-gif Sep 28, 2025
19fbde3
chore: make lint happy fro bridge
nnn-gif Sep 28, 2025
bb38e3f
chore: fix vet
nnn-gif Sep 28, 2025
5c2ac9f
fix: update bridge tests
nnn-gif Sep 28, 2025
c4c846c
fix: fix bridge tests
nnn-gif Sep 28, 2025
088efaf
feat: update script to add authorised signer
nnn-gif Sep 28, 2025
38f060d
fix: update script to use same domain
nnn-gif Sep 28, 2025
b5c133e
feat: shut all routine gracefully
nnn-gif Sep 30, 2025
44d2c34
feat: use yml instead of long json
nnn-gif Sep 30, 2025
80d7ee1
feat: replace logrus with logger
nnn-gif Oct 3, 2025
a642276
feat: pass secrets via env
nnn-gif Oct 4, 2025
049685f
feat: fix logs
nnn-gif Oct 5, 2025
af76003
feat: remove old registry
nnn-gif Oct 5, 2025
1d8c0cb
chore: fix go lint
nnn-gif Oct 5, 2025
963d869
chore: fix test for router
nnn-gif Oct 5, 2025
7001ce4
chrore: check for nil
nnn-gif Oct 5, 2025
3334582
chore: skip rpc timeout test tem
nnn-gif Oct 5, 2025
006bc56
feat: fix worker pool
nnn-gif Oct 5, 2025
e2a10bd
chore: remove unused code
nnn-gif Oct 5, 2025
d955794
chore: fix lint
nnn-gif Oct 5, 2025
3d93700
feat: move intent reflect to enricher
nnn-gif Oct 5, 2025
fd04bee
feat: move all tx action to tx handler
nnn-gif Oct 5, 2025
f766603
feat: show all paths
nnn-gif Oct 6, 2025
18330d5
chore: add remapping
nnn-gif Oct 6, 2025
6765fd1
chore: update remapping
nnn-gif Oct 6, 2025
2422d1a
chore: add gitmodules
nnn-gif Oct 6, 2025
d72bc3a
feat: show prublic address with keys
nnn-gif Oct 7, 2025
bcf0576
feat: move all configs to submodule
nnn-gif Oct 7, 2025
9f1af11
feat: for network trim spaces in file creation
nnn-gif Oct 7, 2025
7d77299
feat: categorise network
nnn-gif Oct 7, 2025
63f9de2
feat: add summary before any chain action
nnn-gif Oct 7, 2025
026ff00
feat: prefix to wallet key name
nnn-gif Oct 8, 2025
7260cae
feat: create contract if not exists in config
nnn-gif Oct 9, 2025
fe299c7
feat: use api to verfy on etherscan based exploreres
nnn-gif Oct 17, 2025
579ec98
feat: orader params
nnn-gif Oct 18, 2025
26d29e3
feat: add similation beofre init transaction
nnn-gif Oct 18, 2025
1ad5039
feat: add transaction queue per account per chain
nnn-gif Oct 28, 2025
48a4efc
feat: attestor to use guarded value
nnn-gif Nov 3, 2025
5100653
feat: nonce manager to use nonce in init and pending nonce in further
nnn-gif Nov 3, 2025
3218a87
feat: nonce manager use nonce at instead of pending
nnn-gif Nov 6, 2025
2095bb6
feat: resue eritelinet for every rpc actions
nnn-gif Nov 7, 2025
4e8dd32
feat: add prime and replica mode in attestor
nnn-gif Nov 11, 2025
a6a142d
feat: use only viper for attestor config
nnn-gif Nov 16, 2025
f711849
feat: check isstarted in defer
nnn-gif Nov 16, 2025
fc0d6c4
feat: fix test for guarded oracle
nnn-gif Nov 16, 2025
aa1478d
feat: generate nocne as singleton
nnn-gif Nov 25, 2025
4511667
feat: lock map based on keys
nnn-gif Nov 25, 2025
f2a60d3
feat: log reason when tx is approved
nnn-gif Nov 25, 2025
14a5fac
feat: oder by timestamp
nnn-gif Nov 26, 2025
ab9caee
feat: move maxSafeGap till client creation
nnn-gif Nov 26, 2025
6b579f1
feat: dynamic nonce reset
nnn-gif Dec 1, 2025
990d6a2
feat: record updates based on chainid and contract
nnn-gif Dec 1, 2025
d679369
feat: add intenthash in log
nnn-gif Dec 2, 2025
9e6da5f
feat: route event spawn go route per action
nnn-gif Dec 2, 2025
66ccdee
feat: UpdateDestinationTime change flow
nnn-gif Dec 2, 2025
b1aa3fd
feat: use common methon on key generation
nnn-gif Dec 2, 2025
9288a65
feat: simplify checkAndReservePriceDeviation
nnn-gif Dec 2, 2025
5a79153
feat: add mterics for queue manager
nnn-gif Dec 3, 2025
4655cf7
feat: add GetSymbolsFromConfig to get symbols from config
nnn-gif Dec 3, 2025
1822d4f
feat: init replica feature in bridge
nnn-gif Dec 4, 2025
53498c9
feat: update eventprocessor to use rpc.EthClient
nnn-gif Dec 4, 2025
fbae169
feat: decouple Transaction handler
nnn-gif Dec 4, 2025
d75ea7c
chore: remove old structs
nnn-gif Dec 4, 2025
250e1f1
feat: remove old stric from API
nnn-gif Dec 4, 2025
884338e
feat: move all metrics related operation of bridge in single place
nnn-gif Dec 4, 2025
3e643cf
feat: add GetMonitoringInfo in onchainmonitor
nnn-gif Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/attestor-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Attestor CI

on:
push:
paths:
- 'services/attestor/**'
- '.github/workflows/attestor-ci.yml'
pull_request:
paths:
- 'services/attestor/**'
- '.github/workflows/attestor-ci.yml'

permissions:
contents: read

jobs:
attestor:
name: Lint / Vet / Test
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: services/attestor
env:
GOFLAGS: -mod=readonly
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: services/attestor/go.mod
cache: true

- name: Download dependencies
run: go mod download

- name: Lint (gofmt)
run: |
fmt_out=$(gofmt -l .)
if [[ -n "$fmt_out" ]]; then
echo "The following files need gofmt:" && echo "$fmt_out"
exit 1
fi

- name: Vet
run: go vet ./...

- name: Test
run: go test ./...
51 changes: 51 additions & 0 deletions .github/workflows/bridge-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Bridge CI

on:
push:
paths:
- 'services/bridge/**'
- '.github/workflows/bridge-ci.yml'
pull_request:
paths:
- 'services/bridge/**'
- '.github/workflows/bridge-ci.yml'

permissions:
contents: read

jobs:
bridge:
name: Lint / Vet / Test
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: services/bridge
env:
GOFLAGS: -mod=readonly
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: services/bridge/go.mod
cache: true

- name: Download dependencies
run: go mod download

- name: Lint (gofmt)
run: |
fmt_out=$(gofmt -l .)
if [[ -n "$fmt_out" ]]; then
echo "The following files need gofmt:" && echo "$fmt_out"
exit 1
fi

- name: Vet
run: go vet ./...

- name: Test
run: go test ./...
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "contracts/lib/openzeppelin-contracts"]
path = contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "contracts/tools/forge-wrapper/config-private"]
path = contracts/tools/forge-wrapper/config-private
url = git@github.com:diadata-org/spectra-deployment-configs.git
3 changes: 2 additions & 1 deletion contracts/.solhint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "solhint:recommended",
"rules": {
"no-global-import": "off"
"no-global-import": "off",
"func-visibility": ["error", {"ignoreConstructors": true}]
}
}

87 changes: 87 additions & 0 deletions contracts/contracts/DIAOracleV2.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.29;

import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

interface IDIAOracleV2 {
function setValue(string memory key, uint128 value, uint128 timestamp) external;
function getValue(string memory key) external view returns (uint128, uint128);
function setMultipleValues(string[] memory keys, uint256[] memory compressedValues) external;
}

/**
* @title DIAOracleV2
* @dev A simple oracle contract that allows an authorized updater to set and retrieve price values with timestamps.
*/
contract DIAOracleV2 is IDIAOracleV2, AccessControl {
bytes32 public constant UPDATER_ROLE = keccak256("UPDATER_ROLE");

/// @notice Mapping to store compressed values of assets (price and timestamp).
/// @dev The stored value is a 256-bit integer where the upper 128 bits store the price and the lower 128 bits store the timestamp.
mapping (string => uint256) public values;

event OracleUpdate(string key, uint128 value, uint128 timestamp);
event UpdaterAddressChange(address newUpdater);

constructor() {
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(UPDATER_ROLE, msg.sender);
}

error MismatchedArrayLengths(uint256 keysLength, uint256 valuesLength);



/**
* @notice Updates the price and timestamp for a given asset key.
* @dev Only callable by the `oracleUpdater`.
* @param key The asset identifier (e.g., "BTC/USD").
* @param value The price value to set.
* @param timestamp The timestamp associated with the value.
*/
function setValue(string memory key, uint128 value, uint128 timestamp) public onlyRole(UPDATER_ROLE) {
uint256 cValue = (((uint256)(value)) << 128) + timestamp;
values[key] = cValue;
emit OracleUpdate(key, value, timestamp);
}

/**
* @notice Updates multiple asset values in a single transaction.
* @dev Each entry in `compressedValues` should be a 256-bit integer where:
* - The upper 128 bits represent the price value.
* - The lower 128 bits represent the timestamp.
* @param keys The array of asset identifiers.
* @param compressedValues The array of compressed values (price and timestamp combined).
*/

function setMultipleValues(string[] memory keys, uint256[] memory compressedValues) public onlyRole(UPDATER_ROLE){
if (keys.length != compressedValues.length) {
revert MismatchedArrayLengths(keys.length, compressedValues.length);
}
for (uint128 i = 0; i < keys.length; i++) {
string memory currentKey = keys[i];
uint256 currentCvalue = compressedValues[i];
uint128 value = (uint128)(currentCvalue >> 128);
uint128 timestamp = (uint128)(currentCvalue % 2**128);

values[currentKey] = currentCvalue;
emit OracleUpdate(currentKey, value, timestamp);
}
}

/**
* @notice Retrieves the price and timestamp for a given asset key.
* @param key The asset identifier (e.g., "BTC/USD").
* @return value The stored price value.
* @return timestamp The stored timestamp.
*/
function getValue(string memory key) external view returns (uint128, uint128) {
uint256 cValue = values[key];
uint128 timestamp = (uint128)(cValue % 2**128);
uint128 value = (uint128)(cValue >> 128);
return (value, timestamp);
}



}
Loading
Loading