Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b2e57d2
support variable header items
Mar 1, 2025
90b6438
add create client validation
Mar 4, 2025
f27c6f2
merge constant and fork const
Mar 4, 2025
2b03581
modify readme
Mar 4, 2025
6b3e2de
add fork rule test
Mar 5, 2025
fab3599
add fork spect test
Mar 5, 2025
1074c97
add milli_timestamp
Mar 5, 2025
524c4a1
make several header field private
Mar 5, 2025
dc10b25
update test
Mar 5, 2025
b83c842
Move resolve_account from update_client to verify_commitment (#84)
yoshidan Mar 14, 2025
40e1d86
fix conflict
Mar 17, 2025
fb1c0b4
fix test
Mar 17, 2025
bb942e3
fix lint
Mar 17, 2025
30c669e
Merge branch 'feature/fork_state' into feature/rolentz_msec
Mar 17, 2025
f089201
change epoch length
Mar 17, 2025
c3981a8
fix clippy
Mar 17, 2025
d24f1c7
remove unused test
Mar 17, 2025
66ff49c
fix conflict
Mar 17, 2025
4752948
refactor
Mar 17, 2025
b4600e1
refactor
Mar 17, 2025
ac5c3af
refactor
Mar 17, 2025
aa0f97d
modify all
Mar 19, 2025
5b00406
update
Mar 19, 2025
405a56d
test
Mar 19, 2025
736a66c
fmt
Mar 19, 2025
171e424
fix test
Mar 19, 2025
b4caad3
fix lint
Mar 19, 2025
92a2cd8
add test
Mar 21, 2025
f1d7a7a
add test
Mar 21, 2025
954d09c
add test
Mar 21, 2025
bafe41f
add test
Mar 21, 2025
232af0e
add test
Mar 21, 2025
9c2b70a
fix clippy
Mar 21, 2025
60be31f
change comment
Mar 21, 2025
dfb4097
change turn length threshold
Mar 21, 2025
7abf528
remove how to change epoch length
Mar 22, 2025
aa04e8d
change turn length validation
Mar 22, 2025
6a471be
Merge branch 'feature/rolentz_msec' into feature/lorentz_seemless
Mar 22, 2025
4f406d0
add test
Mar 23, 2025
fe882f2
fix fmt
Mar 23, 2025
0084d73
change canonicalize
Mar 23, 2025
1f6c1df
tweak
Mar 24, 2025
a49bf94
check strict
Mar 26, 2025
3f7931f
fix-lint
Mar 26, 2025
bb8a848
add max_turn_length into ForkSpec
Mar 26, 2025
23b2e38
add test
Mar 27, 2025
24a05f2
refactor
Mar 27, 2025
ea54f2c
fix clippy
Mar 27, 2025
857cc4c
change comment
Mar 27, 2025
31cfb45
fix ci warning
Apr 1, 2025
54064d6
Merge branch 'feature/fork_state' into feature/rolentz_msec
Apr 1, 2025
a479930
fix conflict
Apr 1, 2025
4689816
fix copilot review
Apr 1, 2025
4578dc7
fix
Apr 4, 2025
bae648c
add comment
Apr 7, 2025
48ae609
add constant
Apr 7, 2025
b9685da
Merge branch 'feature/fork_state' into feature/rolentz_msec
Apr 7, 2025
4a57acf
fix conflict
Apr 7, 2025
a149c01
add comment
Apr 7, 2025
2ab7fc1
Merge pull request #86 from datachainlab/feature/lorentz_seemless
yoshidan Apr 7, 2025
69b29b2
Merge pull request #85 from datachainlab/feature/rolentz_msec
yoshidan Apr 7, 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
22 changes: 2 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
Expand Down Expand Up @@ -47,23 +47,5 @@ jobs:
command: test
args: --release --features=dev --manifest-path light-client/Cargo.toml --lib test::dev_test_min
env:
MINIMUM_TIMESTAMP_SUPPORTED: 1731495592
MINIMUM_TIMESTAMP_SUPPORTED: 110
MINIMUM_HEIGHT_SUPPORTED: 100
- uses: actions-rs/cargo@v1
name: unit-test-dev-test-pascal
with:
command: test
args: --release --features=dev --manifest-path light-client/Cargo.toml --lib test::dev_test_after_pascal
env:
MINIMUM_TIMESTAMP_SUPPORTED: 1
MINIMUM_HEIGHT_SUPPORTED: 1
PASCAL_TIMESTAMP: 1
- uses: actions-rs/cargo@v1
name: unit-test-dev-test-pascal
with:
command: test
args: --release --features=dev --manifest-path light-client/Cargo.toml --lib test::dev_test_before_pascal
env:
MINIMUM_TIMESTAMP_SUPPORTED: 1
MINIMUM_HEIGHT_SUPPORTED: 1
PASCAL_TIMESTAMP: 1800000000
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
NOTE: This project is currently under heavy development. Features may change or break.

## Supported Versions
- [lcp v0.2.9](https://github.com/datachainlab/lcp/releases/tag/v0.2.9)
- [BSC v1.4.13](https://github.com/bnb-chain/bsc/releases/tag/v1.4.13)
- [lcp v0.2.12](https://github.com/datachainlab/lcp/releases/tag/v0.2.12)
- [BSC v1.5.5](https://github.com/bnb-chain/bsc/releases/tag/v1.5.5)

## Documents

Expand All @@ -19,20 +19,11 @@ NOTE: This project is currently under heavy development. Features may change or
Environment variables can be used to change settings.
Each configuration must be determined at build time, not at run time.

### Blocks per epoch
You can change the blocks per epoch for localnet.
This is available in dev feature only.

```sh
BSC_BLOCKS_PER_EPOCH=20 cargo build --features=dev
```

### Build Parameters

Parameters can be specified to check for acceptable headers at build time.

| Name | Description |
| --- |-------------------------------------------------------------------------------------------------------------------------------------------------|
| `MINIMUM_TIMESTAMP_SUPPORTED` | Timestamp of the lowest header this light client will accept |
| `MINIMUM_HEIGHT_SUPPORTED` | Height of the lowest header this light client will accept |
| `PASCAL_TIMESTAMP` | Timestamp of the first Pascal Hardfork header, used to check the header structure after Pascal Hardfork; if 0 is specified, no check is made. |
| Name | Description |
| --- |------------------------------------------------------------------------------------------------------------------------------|
| `MINIMUM_TIMESTAMP_SUPPORTED` | Timestamp(millisecond) of the lowest header this light client will accept. All the ForkSpec must be greater than or equal to this value. |
| `MINIMUM_HEIGHT_SUPPORTED` | Height of the lowest header this light client will accept. All the ForkSpec must be greater than or equal to this value. |
47 changes: 16 additions & 31 deletions light-client/build.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
fn main() {
#[cfg(feature = "dev")]
{
use std::io::Write;
let mut file = std::fs::File::create("src/header/constant.rs").unwrap();
let blocks_per_epoch =
std::env::var("BSC_BLOCKS_PER_EPOCH").unwrap_or_else(|_| "200".to_string());
writeln!(
file,
"pub const BLOCKS_PER_EPOCH: u64 = {};",
blocks_per_epoch,
)
.unwrap();
}
use std::io::Write;
let mut file = std::fs::File::create("src/header/constant.rs").unwrap();
let mut values: Vec<String> = vec![];
let minimum_time_stamp_supported =
std::env::var("MINIMUM_TIMESTAMP_SUPPORTED").unwrap_or_else(|_| "0".to_string());
values.push(format!(
"pub const MINIMUM_TIMESTAMP_SUPPORTED: u64 = {};",
minimum_time_stamp_supported
));
let minimum_height_supported =
std::env::var("MINIMUM_HEIGHT_SUPPORTED").unwrap_or_else(|_| "0".to_string());
values.push(format!(
"pub const MINIMUM_HEIGHT_SUPPORTED: u64 = {};",
minimum_height_supported
));

{
use std::io::Write;
let mut file = std::fs::File::create("src/header/hardfork.rs").unwrap();
let minimum_time_stamp_supported =
std::env::var("MINIMUM_TIMESTAMP_SUPPORTED").unwrap_or_else(|_| "0".to_string());
let minimum_height_supported =
std::env::var("MINIMUM_HEIGHT_SUPPORTED").unwrap_or_else(|_| "0".to_string());
let pascal_timestamp =
std::env::var("PASCAL_TIMESTAMP").unwrap_or_else(|_| "0".to_string());
writeln!(
file,
"pub const MINIMUM_TIMESTAMP_SUPPORTED: u64 = {};\npub const MINIMUM_HEIGHT_SUPPORTED: u64 = {};\npub const PASCAL_TIMESTAMP: u64 = {};",
minimum_time_stamp_supported,
minimum_height_supported,
pascal_timestamp
)
.unwrap();
}
writeln!(file, "{}", values.join("\n")).unwrap();
}
Loading
Loading