From 8df689bd448390c44ee2c344314257a5987a2e97 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 30 Dec 2014 15:42:26 +0100 Subject: [PATCH] Chain tests --- _data/invalid1 | Bin 0 -> 36072 bytes _data/{chain1 => valid1} | Bin _data/{chain2 => valid2} | Bin _data/valid3 | Bin 0 -> 14712 bytes _data/valid4 | Bin 0 -> 12496 bytes core/chain_manager_test.go | 53 +++++++++++++++++++++++++++++++++---- 6 files changed, 48 insertions(+), 5 deletions(-) create mode 100755 _data/invalid1 rename _data/{chain1 => valid1} (100%) rename _data/{chain2 => valid2} (100%) create mode 100755 _data/valid3 create mode 100755 _data/valid4 diff --git a/_data/invalid1 b/_data/invalid1 new file mode 100755 index 0000000000000000000000000000000000000000..9c24b13e8e8f7f54c6a8434781e8a958bd56bd3e GIT binary patch literal 36072 zcmeI)Wl)rj8!qrA1%X|M_YX1~iu+H~;al(wSvSb1QDfaS*9maI9np4b-Zl`iuW> zehG(2~>*e3e<1TK?wdJsiqC z95O^e29pB`Uh_UziZZ>@wFe86i#iuoJOmIH>I+Txbms2DldU4uCcpmba8GS9xb!Q| zfSRwfQ9pi9xl$9C)O&c5TIeL({l0Kqwi;{Y(_ z+wchEtW*U!LdarYYybimx}0T1r1!=wQ8~_cHk3V~R6LNo@sTD!5fY_I#kSAzyIc4d zt~z|KX>M`%QOZwD0@Ddq9?K@9)gJh0P+0GZK|}>?3OrtNUZ|=4Z9MqIWbQZQ%h7G( zpoir0wiTeAK?4{;ImQKG@-I(Ow6=y*S>l%|NlP5gkXA0{TXB>O@6FKL!EO`+H zWK$O-%=ci2CMpn^C>j(1qSGx~OGtS3Srutq)+6^UE4k77s4|P{u+OT|`?dz4ok0Vb zK*0$i0AM0gCnzd##P-bHTZ?tvXYkGMj(;fqLK?OdzL8*>(Ga5dKB$|S#u$n6E%-yr zAHkM8xb6Y&lgsOkS+*=pfw4{F*+kD2VUo{`(V*;W*A%74rF>(gI@GIKEuXg!Efw7^ z+GOuFd(|ku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A>&z6e!ru85Ahk%^4IZ*v%Of yDA>&z6e!ru85Ahk%^4IZ*v%OfDA>&z6e!ru85Ahk%^4IZ*v%OfDF2^s&io&R<&_=) literal 0 HcmV?d00001 diff --git a/_data/chain1 b/_data/valid1 similarity index 100% rename from _data/chain1 rename to _data/valid1 diff --git a/_data/chain2 b/_data/valid2 similarity index 100% rename from _data/chain2 rename to _data/valid2 diff --git a/_data/valid3 b/_data/valid3 new file mode 100755 index 0000000000000000000000000000000000000000..685bc9fd7b38505d26c9d16223c9a55f23abcdf3 GIT binary patch literal 14712 zcmd7ZWl&V%zXx#X-X$dkDd`TS5hO%fLQtfnq>;|WLkSAfk{&`*1SAxYMi4;+1WA!j zB?OTrua`UQ|IOVwb7yw$$V=us?0i4-d(J-doCl zhS%8D_6{+8p;Tc^iuR=1%uza097lSnp1Fk*U$gf**q)Q%ZME%!dV&=7tAp1fFFaUyeg1`dc@~((5 zgWU2Z1b9o2y!T0SYjeO_mf`FSyMcm-Qt;sG?2!X5N$vKF53iz7`YU(Wl1BR1;`zC} z2+NZqJ8S879{BCZGIOwga9%suMT4TDAMW<1xj6!SY4=iYc2b0)RfxN(+|MBl>BF`- z*mMlp88UzoloM*p4$^J8x=i8c(I?JM>XFh^kxuW+5HpR%c z(kVY0f;7Lr=bJ_uqEOtu45NFn!CLn_+Vmey`D2|PyI=9hOEs6D*TyVWW(r@uCsyhOO5=Tk#DqoNFBx9mMd0Xj0tK0G)U!jPY zuJT)dA5DOy6B-mjqIUV}@zQJ7o{@J6Z10**!eq}E9=8CAxT(oYk#w?guXDIj_Zj?ED*GShAWrm1e&Fyh}dD1XncL;G_x=J`kOdgIxp?xR7TAtN7$1Q1Ih>-bA;2A-@B6|@#rp9YgbZIyK9r{6RZA3WQVMjsZy#WNttCXE zM6lLdhLwiOyjsnv&gH4!X<2n-8zTOllhWAa!t!|+2Mvlpy#*nuMdG)Z(CEfX7jeof z^9Wbf85QR06XOuGX=0g>g8&)8#H3&c6990o>{FB<2+*@Y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1+Ih^kG09<^Fh zk~+FnS$T)CW8Q^O>4B16m3bo5`B|SMDl{nhGpl)4<;zc_?Yy$YDrC4T=>YLY#PH)w z!7=w%so(q~r}@-cya4P4%P9&W0{jsXz`i5k8*fJ4DW;<5Vm5(GdlWI=P(H-R2@p6U6b zAYs3e=g*D0YI0wJ295$%0a9L&j||8FCY~wOgM0ui$Lkb@2mu!FBaKps$Q7a{tJ}g{ zcL+YUuHeKeNsLH(tVxtb*~XwIrB;cik`V{nq0z`VK#P5 zH8d#N@Xd3NuOL4UeEA_GK3K4PQyz&IM~|`vNL1=6DTyse{X1I^`4>p z;T(MYQC0()WMYE<&ZZ_>s_eyc`^_yOE3y7O@vf2=C=|I+Ynxn&&|vYt$~}uFIc%-H zR{g@2WtH{mevM99qZ2eJxw7%060cI}^LW?3rp1%q7s5L9A|jYvxiBSw3|sa+fb0wz zzzE8u002ureZ^5hi~zk}>fulXjeEQcFR!FI+G!5bS83d;oS9VTP};r;Lg83rNN zzRvXDD=zmxHaD9O$dYtgst= zIx9Y1Kr)1b0kg-9%y>e> zx@ab4K&FJTL1rUla7GfjCZ9Wp*r0&v9!T7v?BYqZHG(07hU~-E&{^I zzYrw5d5@?>If^3vk#3h|w60N-ZM1p6zC1~7p_=OqfjBG*nQg%kn082{uht1gt)iF~CNp1D|}8(vIh zE^enJRa$f@hC-AZwR{RQMNJ>wzS-ZCD)saClF3sxj)a7q_!fryLKlU?x3JHlK{0Gt z|2(*0P)5jOzGA9}#XReHKDAL)#aI4Xq@1`w$~t6c$N)xA4#WUh*!43M$p@uA%LRlq z#CBKH0*zc=#pEtBz0|bOY_ghtO8s?C7lpEHWpJX?drQ@WVdfz54R`JdLG-sT1n+-z z{x++I=V5ujQ{`u literal 0 HcmV?d00001 diff --git a/_data/valid4 b/_data/valid4 new file mode 100755 index 0000000000000000000000000000000000000000..fc016057fa38e5c4f2f88129159540398f5cc1f9 GIT binary patch literal 12496 zcmd7YcR1A#|HpBAgmbczRW_M%kYtatMNWt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5SI(?12jVFN@S-s&b!}|*eZRlF{-ZEw zqVnCv?n*>_)Vrq0lEjIQmnsjv53!&)U!vF`>^*TG<%sikvZM@Og)~f03|ml)c+@Iy z>qGt}&r@h*c>qYof8O482ZzLvF8I9jPg9T-jN6vw?@)}>DHoeY!^8~d| zkMe~W{Lwd}8?^S>*XZd$4*@j5#ih`+@B)xh&eKbQBT?x+F8Ong-Y{1Diy=NtFV>%K zAL_S%Qs6k&*!;E7F8|+m9iUQ%2ONvy!cwzUtV-j$haT%wr2A|dd5DS)x)1%zkHLb{ zcdqnzOr`?az3^fVZZ>6^ZfQ#PtF11adXg++3-Cir(9NI$E>LJy`2a}a<1>_B$mH>^ zZ|`mjdH5_B_YfD@F? zD*z<7>lDQhiK5%r3$$7ej51?%NTsSEO|!k&KLCH%=lHk$Mn0)jbUg-zGesl$Yd&ur zerk)tbz0ib*5y5G3;iexli{?Y2MvZVv7k^Aaj-o9p7N6N{AIxcGr`8)!{J>wXGpPl z=btshyusU`n?VCypwMaa1CV!@Pf?7JD8v^23N(F?SKWy{k<4DhnJLC7)l}=}w_NIr zG7h6k78sPp19)zN!+4z8*Wx3W33W>WiUO~CSdZRS&qJ@E$c|YoDBg8U+>UPo(uCdp z-iO^NRKD?f-SF>n`B1>G9cP)~x*pKYpaD)$h6Dgey5||nYbkO(6*E+#j1wmG4Oxd>oe)X1W=ek_c)^_?F=>MZ z#aX!Kf{j$WRY9=%?eA}M2V-l$^M@#nrX`lBBCZW5x`S>84RC=%Zzu>rQhH8NjFBia m&Vez>>DY!s(k^w0uKFK+OoK#55VKFz>WJ(Q>Moki&Ho4J9E8#U literal 0 HcmV?d00001 diff --git a/core/chain_manager_test.go b/core/chain_manager_test.go index 6e85bae9a1..1087189015 100644 --- a/core/chain_manager_test.go +++ b/core/chain_manager_test.go @@ -6,6 +6,7 @@ import ( "path" "reflect" "runtime" + "strconv" "testing" "github.com/ethereum/go-ethereum/core/types" @@ -13,15 +14,15 @@ import ( "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/rlp" - //logpkg "github.com/ethereum/go-ethereum/logger" ) //var Logger logpkg.LogSystem + //var Log = logpkg.NewLogger("TEST") func init() { runtime.GOMAXPROCS(runtime.NumCPU()) - //Logger = logpkg.NewStdLogSystem(os.Stdout, log.LstdFlags, logpkg.InfoLevel) + //Logger = logpkg.NewStdLogSystem(os.Stdout, log.LstdFlags, logpkg.DebugLevel) //logpkg.AddLogSystem(Logger) ethutil.ReadConfig("/tmp/ethtest", "/tmp/ethtest", "ETH") @@ -50,21 +51,22 @@ func loadChain(fn string, t *testing.T) (types.Blocks, error) { func insertChain(done chan bool, chainMan *ChainManager, chain types.Blocks, t *testing.T) { err := chainMan.InsertChain(chain) + done <- true if err != nil { fmt.Println(err) t.FailNow() } - done <- true } func TestChainInsertions(t *testing.T) { - chain1, err := loadChain("chain1", t) + chain1, err := loadChain("valid1", t) if err != nil { fmt.Println(err) t.FailNow() } + fmt.Println(len(chain1)) - chain2, err := loadChain("chain2", t) + chain2, err := loadChain("valid2", t) if err != nil { fmt.Println(err) t.FailNow() @@ -94,3 +96,44 @@ func TestChainInsertions(t *testing.T) { t.Error("chain1 isn't canonical and should be") } } + +func TestChainMultipleInsertions(t *testing.T) { + const max = 4 + chains := make([]types.Blocks, max) + var longest int + for i := 0; i < max; i++ { + var err error + name := "valid" + strconv.Itoa(i+1) + chains[i], err = loadChain(name, t) + if len(chains[i]) >= len(chains[longest]) { + longest = i + } + fmt.Println("loaded", name, "with a length of", len(chains[i])) + if err != nil { + fmt.Println(err) + t.FailNow() + } + } + + var eventMux event.TypeMux + chainMan := NewChainManager(&eventMux) + txPool := NewTxPool(chainMan, &eventMux) + blockMan := NewBlockManager(txPool, chainMan, &eventMux) + chainMan.SetProcessor(blockMan) + done := make(chan bool, max) + for i, chain := range chains { + var i int = i + go func() { + insertChain(done, chainMan, chain, t) + fmt.Println(i, "done") + }() + } + + for i := 0; i < max; i++ { + <-done + } + + if !reflect.DeepEqual(chains[longest][len(chains[longest])-1], chainMan.CurrentBlock()) { + t.Error("Invalid canonical chain") + } +}