Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
b0e55330
Unverified
Commit
b0e55330
authored
6 months ago
by
bgallois
Browse files
Options
Downloads
Patches
Plain Diff
add oracle file versioning
parent
d84ed2c2
No related branches found
No related tags found
1 merge request
!290
Fix #262 distance oracle pool index
Pipeline
#38906
passed
6 months ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/distance/src/lib.rs
+4
-1
4 additions, 1 deletion
client/distance/src/lib.rs
distance-oracle/src/lib.rs
+4
-1
4 additions, 1 deletion
distance-oracle/src/lib.rs
with
8 additions
and
2 deletions
client/distance/src/lib.rs
+
4
−
1
View file @
b0e55330
...
@@ -40,6 +40,9 @@ use sp_runtime::{generic::BlockId, traits::Block as BlockT, AccountId32};
...
@@ -40,6 +40,9 @@ use sp_runtime::{generic::BlockId, traits::Block as BlockT, AccountId32};
use
std
::
path
::
PathBuf
;
use
std
::
path
::
PathBuf
;
/// The file version that should match the distance oracle one.
/// The file version that should match the distance oracle one.
/// This ensures that the smith avoids accidentally submitting invalid data
/// in case there are changes in logic between the runtime and the oracle,
/// thereby preventing potential penalties.
const
VERSION_PREFIX
:
&
str
=
"001-"
;
const
VERSION_PREFIX
:
&
str
=
"001-"
;
type
IdtyIndex
=
u32
;
type
IdtyIndex
=
u32
;
...
@@ -152,7 +155,7 @@ where
...
@@ -152,7 +155,7 @@ where
Err
(
e
)
=>
{
Err
(
e
)
=>
{
match
e
.kind
()
{
match
e
.kind
()
{
std
::
io
::
ErrorKind
::
NotFound
=>
{
std
::
io
::
ErrorKind
::
NotFound
=>
{
log
::
debug!
(
"🧙 [distance oracle] Evaluation result file not found
"
);
log
::
debug!
(
"🧙 [distance oracle] Evaluation result file not found
. Please ensure that the oracle version matches {}"
,
VERSION_PREFIX
);
}
}
_
=>
{
_
=>
{
log
::
error!
(
log
::
error!
(
...
...
This diff is collapsed.
Click to expand it.
distance-oracle/src/lib.rs
+
4
−
1
View file @
b0e55330
...
@@ -64,7 +64,10 @@ use log::{debug, info, warn};
...
@@ -64,7 +64,10 @@ use log::{debug, info, warn};
use
rayon
::
iter
::{
IntoParallelRefIterator
,
ParallelIterator
};
use
rayon
::
iter
::{
IntoParallelRefIterator
,
ParallelIterator
};
use
std
::{
io
::
Write
,
path
::
PathBuf
};
use
std
::{
io
::
Write
,
path
::
PathBuf
};
/// The file version that must match the version used by the inherent data provider.
/// The file version must match the version used by the inherent data provider.
/// This ensures that the smith avoids accidentally submitting invalid data
/// in case there are changes in logic between the runtime and the oracle,
/// thereby preventing potential penalties.
const
VERSION_PREFIX
:
&
str
=
"001-"
;
const
VERSION_PREFIX
:
&
str
=
"001-"
;
#[subxt::subxt(runtime_metadata_path
=
"../resources/metadata.scale"
)]
#[subxt::subxt(runtime_metadata_path
=
"../resources/metadata.scale"
)]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment