-
Notifications
You must be signed in to change notification settings - Fork 5
fix: eth66 serve signature #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
a9f1127
feat: integrate l2geth in docker-compose e2e tests
c431b54
Merge branch 'main' into e2e-test-integrate-l2geth
21fe045
Merge branch 'main' into e2e-test-integrate-l2geth
colinlyguo e3bb57f
support local genesis
cd57546
Merge branch 'main' into feat-support-genesis-file
colinlyguo 39dc24c
address comments
21c7f2d
fix CI
c71aea3
Merge branch 'main' into e2e-test-integrate-l2geth
colinlyguo bf3dcb1
update scripts
13a7364
increase log level
cf2b45c
update gas limits
eff6dd2
Merge branch 'feat-support-genesis-file' into e2e-test-integrate-l2geth
0abcdc5
update reth commit
6d59e25
Add default trait for Database
yiweichi 3ec60d4
fix: eth66 serve signature
yiweichi daecde2
update database
yiweichi f3dd12f
update dependency
yiweichi 846e0e1
add save safe signature
yiweichi 0ad94fc
Merge branch 'main' into morty/fix-eth66-serve-signature
yiweichi c796be5
merge morty/fix-eth66-serve-signature
yiweichi 07da09f
merge morty/fix-eth66-serve-signature
yiweichi 70fc90b
fix: test
yiweichi 6c835c2
fix: enable signature eip191
yiweichi 90034fb
Revert "fix: enable signature eip191"
yiweichi f4325d7
fix: orm DatabaseError(UnpackInsertId)
yiweichi 5dc3c3e
fix: orm DatabaseError(ConnectionAcquire(Timeout))
yiweichi 66922be
fix: orm DatabaseError(UnpackInsertId)
yiweichi 7017e38
fix: orm DatabaseError(ConnectionAcquire(Timeout))
yiweichi 7de3c5b
remove used code
yiweichi b91b4e6
update dependency
yiweichi 95a2411
update dependency
yiweichi 435057e
make signature persistence async
yiweichi cee06a4
cargo update
yiweichi b356019
make signature persistence async
yiweichi 33c87e4
update dependency
yiweichi d6cf3f3
feat: implement signature with 0|1 v
yiweichi 405343b
feat: implement signature with 0|1 v
yiweichi c5717cc
cargo update
yiweichi 63ae458
cargo update
yiweichi c707fe3
add comments
yiweichi 0f6cd6b
fix: signer test
yiweichi c382282
add SignatureAsBytes
yiweichi 3be6681
update dep
yiweichi f6cc051
fix: signer test
yiweichi c7ece53
update dep
yiweichi f19f7eb
update dep
yiweichi 5d897cd
support set signer via flag
yiweichi 77a57e3
support set signer via flag
yiweichi 771984d
update dep
yiweichi 0532180
update dep
yiweichi 2a06d91
support local test
yiweichi 43e59ce
fix: broadcast block with new signature encode
yiweichi 307d92a
fix: broadcast block with new signature encode
yiweichi 23cd31e
remove test
yiweichi 7459451
merge main
yiweichi e97cac2
merge main
yiweichi ad76653
update database default connects count
yiweichi 1319211
Merge branch 'main' into morty/fix-eth66-serve-signature
yiweichi 10c671f
cargo fmt
yiweichi f2e4716
cargo clippy
yiweichi 3f3a980
fix: ci
yiweichi 860d712
Revert "fix: ci"
yiweichi 39cd1f1
fix: ci no_std
yiweichi e6db208
refactor scroll network build
yiweichi 336932d
refactor move ScrollHeaderTransform to rollup node
yiweichi bfb386b
address comments
yiweichi 607032f
address comments
yiweichi 2e1ed64
merge main
yiweichi 58217dc
cargo update
yiweichi 43d110b
remove dependency
yiweichi d377aa7
fix: ci test/integration increase timeout
yiweichi 4ebcb29
fix: ci test/integration increase timeout
yiweichi b01c0d6
revert fix ci test/integration increase timeout
yiweichi 5538b31
Merge branch 'main' into morty/fix-eth66-serve-signature
yiweichi b51f088
Merge branch 'main' into morty/fix-eth66-serve-signature
yiweichi ad0718d
update reth dependency branch
yiweichi 9ea4484
fix: ci test oom
yiweichi 688869e
fix: ci test oom
yiweichi 8af917a
upgrade ci machine
yiweichi d82a68d
upgrade ci machine
yiweichi 9673d57
upgrade ci machine
yiweichi adfd084
fix: increase integration-docker-compose timeout
yiweichi 8667b83
Merge branch 'main' into morty/fix-eth66-serve-signature
yiweichi e467bbe
fix: increase integration-docker-compose timeout
yiweichi 58c1b4d
Merge branch 'main' into morty/fix-eth66-serve-signature
yiweichi 6489379
update to async trait for header response transform
frisitano c1e4df5
Merge branch 'main' into morty/fix-eth66-serve-signature
frisitano a950e86
fix: ci
yiweichi d543ac4
fix comments
yiweichi e82ac70
repoint dependencies
frisitano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| use alloy_primitives::{Signature, B256}; | ||
| use sea_orm::{entity::prelude::*, ActiveValue}; | ||
|
|
||
| /// A database model that represents a block signature. | ||
yiweichi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] | ||
| #[sea_orm(table_name = "block_signature")] | ||
| pub struct Model { | ||
| /// The block hash as a primary key. | ||
| #[sea_orm(primary_key)] | ||
| pub block_hash: Vec<u8>, | ||
| /// The block signature. | ||
| pub signature: Vec<u8>, | ||
| } | ||
|
|
||
| /// The relation for the block signature model. | ||
| #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
| pub enum Relation {} | ||
|
|
||
| /// The active model behavior for the block signature model. | ||
| impl ActiveModelBehavior for ActiveModel {} | ||
|
|
||
| impl Model { | ||
| /// Get the block hash as B256 | ||
| pub fn get_block_hash(&self) -> Result<B256, String> { | ||
| if self.block_hash.len() != 32 { | ||
| return Err(format!("Invalid block hash length: {}", self.block_hash.len())); | ||
| } | ||
| Ok(B256::from_slice(&self.block_hash)) | ||
| } | ||
|
|
||
| /// Get the signature | ||
| pub fn get_signature(&self) -> Result<Signature, String> { | ||
| if self.signature.len() != 65 { | ||
| return Err(format!("Invalid signature length: {}", self.signature.len())); | ||
| } | ||
| Signature::from_raw(&self.signature).map_err(|e| format!("Invalid signature: {}", e)) | ||
| } | ||
| } | ||
|
|
||
| impl From<(B256, Signature)> for ActiveModel { | ||
| fn from((block_hash, signature): (B256, Signature)) -> Self { | ||
| Self { | ||
| block_hash: ActiveValue::Set(block_hash.to_vec()), | ||
| signature: ActiveValue::Set(signature.as_bytes().to_vec()), | ||
| } | ||
| } | ||
| } | ||
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
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
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
31 changes: 31 additions & 0 deletions
31
crates/database/migration/src/m20250820_141702_block_signature.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| use sea_orm_migration::{prelude::*, schema::*}; | ||
|
|
||
| #[derive(DeriveMigrationName)] | ||
| pub struct Migration; | ||
|
|
||
| #[async_trait::async_trait] | ||
| impl MigrationTrait for Migration { | ||
| async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
| manager | ||
| .create_table( | ||
| Table::create() | ||
| .table(BlockSignature::Table) | ||
| .if_not_exists() | ||
| .col(binary_len(BlockSignature::BlockHash, 32).primary_key()) | ||
| .col(binary_len(BlockSignature::Signature, 65)) | ||
| .to_owned(), | ||
| ) | ||
| .await | ||
| } | ||
|
|
||
| async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
| manager.drop_table(Table::drop().table(BlockSignature::Table).to_owned()).await | ||
| } | ||
| } | ||
|
|
||
| #[derive(DeriveIden)] | ||
| pub enum BlockSignature { | ||
| Table, | ||
| BlockHash, | ||
| Signature, | ||
| } |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.