Skip to content

Commit 8de5211

Browse files
authored
Merge branch 'develop' into feature/NONEVM-745-logpoller-db-models
2 parents 1256363 + 7e18016 commit 8de5211

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3986
-660
lines changed

contracts/Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/crates/arrayvec/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "arrayvec"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
edition = "2018"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

contracts/crates/arrayvec/src/lib.rs

+43
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ macro_rules! arrayvec {
9090
self.xs[offset..offset + len].copy_from_slice(&data);
9191
self.len += len as $capacity_ty;
9292
}
93+
94+
/// Removes the last element from the array and returns it.
95+
/// Returns `None` if the array is empty.
96+
pub fn pop(&mut self) -> Option<$ty> {
97+
if self.len > 0 {
98+
self.len -= 1;
99+
Some(self.xs[self.len as usize])
100+
} else {
101+
None
102+
}
103+
}
93104
}
94105

95106
impl std::ops::Deref for $name {
@@ -126,6 +137,38 @@ mod tests {
126137
}
127138
arrayvec!(ArrayVec, u8, u32);
128139

140+
#[test]
141+
fn push_pop() {
142+
let mut vec = ArrayVec::new();
143+
assert!(vec.is_empty());
144+
assert_eq!(vec.pop(), None);
145+
146+
vec.push(10);
147+
assert_eq!(vec.len(), 1);
148+
assert_eq!(vec.as_slice(), &[10]);
149+
150+
vec.push(20);
151+
vec.push(30);
152+
assert_eq!(vec.len(), 3);
153+
assert_eq!(vec.as_slice(), &[10, 20, 30]);
154+
155+
// Popping elements
156+
assert_eq!(vec.pop(), Some(30));
157+
assert_eq!(vec.len(), 2);
158+
assert_eq!(vec.as_slice(), &[10, 20]);
159+
160+
assert_eq!(vec.pop(), Some(20));
161+
assert_eq!(vec.len(), 1);
162+
assert_eq!(vec.as_slice(), &[10]);
163+
164+
assert_eq!(vec.pop(), Some(10));
165+
assert_eq!(vec.len(), 0);
166+
assert!(vec.is_empty());
167+
168+
// Popping from empty vec
169+
assert_eq!(vec.pop(), None);
170+
}
171+
129172
#[test]
130173
fn remove() {
131174
let mut vec = ArrayVec::new();

docs/relay/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ chainlink nodes solana create --name=<node-name> --chain-id=<chain-id> --url=<ur
4343
| `OCR2CacheTTL` | stale OCR2 cache deadline | 1m | |
4444
| `TxTimeout` | timeout to send tx to rpc endpoint | 1m | |
4545
| `TxRetryTimeout` | duration for tx to be rebroadcast to rpc, txm stops rebroadcast after timeout | 10s | |
46-
| `TxConfirmTimeout` | duration when confirming a tx signature before signature is discarded as unconfirmed | 30s | |
47-
| `SkipPreflight` | enable or disable preflight checks when sending tx | `true` | `true`, `false` |
46+
| `TxConfirmTimeout` | duration when confirming a tx signature before signature is discarded as unconfirmed | 30s |
47+
| `TxExpirationRebroadcast` | enables or disables transaction rebroadcast if expired. Expiration check is performed every `ConfirmPollPeriod`. A transaction is considered expired if the blockhash it was sent with is 150 blocks older than the latest blockhash. | `false` | `true`, `false` |
48+
| `SkipPreflight` | enables or disables preflight checks when sending tx | `true` | `true`, `false` |
4849
| `Commitment` | Confirmation level for solana state and transactions. ([documentation](https://docs.solana.com/developing/clients/jsonrpc-api#configuring-state-commitment)) | `confirmed` | `processed`, `confirmed`, `finalized` |
4950
| `MaxRetries` | Parameter when sending transactions, how many times the RPC node will automatically rebroadcast a tx, default = `0` for custom txm rebroadcasting method, set to `-1` to use the RPC node's default retry strategy | `0` | |

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ require (
2121
github.com/stretchr/testify v1.9.0
2222
go.uber.org/zap v1.27.0
2323
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
24-
golang.org/x/sync v0.8.0
25-
golang.org/x/text v0.19.0
24+
golang.org/x/sync v0.10.0
25+
golang.org/x/text v0.21.0
2626
)
2727

2828
require (

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
799799
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
800800
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
801801
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
802-
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
803-
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
802+
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
803+
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
804804
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
805805
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
806806
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -868,8 +868,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
868868
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
869869
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
870870
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
871-
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
872-
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
871+
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
872+
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
873873
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
874874
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
875875
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

integration-tests/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ require (
2525
github.com/stretchr/testify v1.9.0
2626
github.com/testcontainers/testcontainers-go v0.34.0
2727
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c
28-
golang.org/x/sync v0.8.0
29-
golang.org/x/text v0.19.0
28+
golang.org/x/sync v0.10.0
29+
golang.org/x/text v0.21.0
3030
gopkg.in/guregu/null.v4 v4.0.0
3131
)
3232

integration-tests/go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -1704,8 +1704,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ
17041704
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
17051705
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
17061706
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
1707-
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
1708-
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
1707+
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
1708+
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
17091709
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
17101710
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
17111711
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -1816,8 +1816,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
18161816
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
18171817
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
18181818
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
1819-
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
1820-
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
1819+
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
1820+
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
18211821
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
18221822
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
18231823
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

integration-tests/relayinterface/chain_components_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (it *SolanaChainComponentsInterfaceTester[T]) Setup(t T) {
132132
Procedure: config.ChainReaderProcedure{
133133
IDLAccount: "DataAccount",
134134
OutputModifications: codec.ModifiersConfig{
135-
&codec.PropertyExtractorConfig{FieldName: "U64value"},
135+
&codec.PropertyExtractorConfig{FieldName: "U64Value"},
136136
},
137137
},
138138
},
@@ -142,7 +142,7 @@ func (it *SolanaChainComponentsInterfaceTester[T]) Setup(t T) {
142142
Procedure: config.ChainReaderProcedure{
143143
IDLAccount: "DataAccount",
144144
OutputModifications: codec.ModifiersConfig{
145-
&codec.PropertyExtractorConfig{FieldName: "U64slice"},
145+
&codec.PropertyExtractorConfig{FieldName: "U64Slice"},
146146
},
147147
},
148148
},
@@ -156,7 +156,7 @@ func (it *SolanaChainComponentsInterfaceTester[T]) Setup(t T) {
156156
Procedure: config.ChainReaderProcedure{
157157
IDLAccount: "DataAccount",
158158
OutputModifications: codec.ModifiersConfig{
159-
&codec.PropertyExtractorConfig{FieldName: "U64value"},
159+
&codec.PropertyExtractorConfig{FieldName: "U64Value"},
160160
},
161161
},
162162
},

pkg/solana/chain.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ func (c *chain) sendTx(ctx context.Context, from, to string, amount *big.Int, ba
575575
}
576576

577577
chainTxm := c.TxManager()
578-
err = chainTxm.Enqueue(ctx, "", tx, nil,
578+
err = chainTxm.Enqueue(ctx, "", tx, nil, blockhash.Value.LastValidBlockHeight,
579579
txm.SetComputeUnitLimit(500), // reduce from default 200K limit - should only take 450 compute units
580580
// no fee bumping and no additional fee - makes validating balance accurate
581581
txm.SetComputeUnitPriceMax(0),

pkg/solana/chain_test.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func TestSolanaChain_MultiNode_Txm(t *testing.T) {
536536
assert.NoError(t, err)
537537
assert.Equal(t, uint64(0), receiverBal)
538538

539-
createTx := func(signer solana.PublicKey, sender solana.PublicKey, receiver solana.PublicKey, amt uint64) *solana.Transaction {
539+
createTx := func(signer solana.PublicKey, sender solana.PublicKey, receiver solana.PublicKey, amt uint64) (*solana.Transaction, uint64) {
540540
selectedClient, err = testChain.getClient()
541541
assert.NoError(t, err)
542542
hash, hashErr := selectedClient.LatestBlockhash(tests.Context(t))
@@ -553,11 +553,12 @@ func TestSolanaChain_MultiNode_Txm(t *testing.T) {
553553
solana.TransactionPayer(signer),
554554
)
555555
require.NoError(t, txErr)
556-
return tx
556+
return tx, hash.Value.LastValidBlockHeight
557557
}
558558

559559
// Send funds twice, along with an invalid transaction
560-
require.NoError(t, testChain.txm.Enqueue(tests.Context(t), "test_success", createTx(pubKey, pubKey, pubKeyReceiver, solana.LAMPORTS_PER_SOL), nil))
560+
tx, lastValidBlockHeight := createTx(pubKey, pubKey, pubKeyReceiver, solana.LAMPORTS_PER_SOL)
561+
require.NoError(t, testChain.txm.Enqueue(tests.Context(t), "test_success", tx, nil, lastValidBlockHeight))
561562

562563
// Wait for new block hash
563564
currentBh, err := selectedClient.LatestBlockhash(tests.Context(t))
@@ -578,8 +579,10 @@ NewBlockHash:
578579
}
579580
}
580581

581-
require.NoError(t, testChain.txm.Enqueue(tests.Context(t), "test_success_2", createTx(pubKey, pubKey, pubKeyReceiver, solana.LAMPORTS_PER_SOL), nil))
582-
require.Error(t, testChain.txm.Enqueue(tests.Context(t), "test_invalidSigner", createTx(pubKeyReceiver, pubKey, pubKeyReceiver, solana.LAMPORTS_PER_SOL), nil)) // cannot sign tx before enqueuing
582+
tx2, lastValidBlockHeight2 := createTx(pubKey, pubKey, pubKeyReceiver, solana.LAMPORTS_PER_SOL)
583+
require.NoError(t, testChain.txm.Enqueue(tests.Context(t), "test_success_2", tx2, nil, lastValidBlockHeight2))
584+
tx3, lastValidBlockHeight3 := createTx(pubKeyReceiver, pubKey, pubKeyReceiver, solana.LAMPORTS_PER_SOL)
585+
require.Error(t, testChain.txm.Enqueue(tests.Context(t), "test_invalidSigner", tx3, nil, lastValidBlockHeight3)) // cannot sign tx before enqueuing
583586

584587
// wait for all txes to finish
585588
ctx, cancel := context.WithCancel(tests.Context(t))

0 commit comments

Comments
 (0)